From waterbug at ned.gsfc.nasa.gov Sun Aug 8 21:35:42 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 21:36:04 2004 Subject: [Pangalactic-commits] And so it begins ... :) Message-ID: <200408090135.i791ZgRA017308@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/enterprise/pgefrole.py None 1.1 PanGalactic/pangalactic/enterprise/__init__.py 1.18 1.19 PanGalactic/pangalactic/enterprise/acu.py 1.10 1.11 PanGalactic/pangalactic/enterprise/dcu.py 1.11 1.12 PanGalactic/pangalactic/enterprise/document.py 1.56 1.57 PanGalactic/pangalactic/enterprise/model.py 1.9 1.10 PanGalactic/pangalactic/enterprise/organization.py 1.19 1.20 PanGalactic/pangalactic/enterprise/part.py 1.8 1.9 PanGalactic/pangalactic/enterprise/partslist.py 1.22 1.23 PanGalactic/pangalactic/enterprise/person.py 1.21 1.22 PanGalactic/pangalactic/enterprise/pgeffile.py 1.24 1.25 PanGalactic/pangalactic/enterprise/pgefobject.py 1.62 1.63 PanGalactic/pangalactic/enterprise/project.py 1.23 1.24 PanGalactic/pangalactic/enterprise/versionedobject.py 1.13 1.14 PanGalactic/pangalactic/enterprise/docptrel.py 1.10 None PanGalactic/pangalactic/enterprise/role.py 1.10 None Log message: And so it begins ... :) Index: PanGalactic/pangalactic/enterprise/__init__.py diff -u PanGalactic/pangalactic/enterprise/__init__.py:1.18 PanGalactic/pangalactic/enterprise/__init__.py:1.19 --- PanGalactic/pangalactic/enterprise/__init__.py:1.18 Mon Apr 19 13:08:37 2004 +++ PanGalactic/pangalactic/enterprise/__init__.py Sun Aug 8 21:35:39 2004 @@ -1,18 +1,17 @@ __all__ = ['acu', 'dcu', - 'docptrel', 'document', + 'mime', 'model', - 'ontoclass', - 'ontoproperty', 'organization', 'part', 'partslist', 'person', + 'personrole', 'pgeffile', 'pgefobject', + 'pgefrepresentation', + 'pgefrole', 'project', - 'property', - 'role', 'versionedobject'] Index: PanGalactic/pangalactic/enterprise/acu.py diff -u PanGalactic/pangalactic/enterprise/acu.py:1.10 PanGalactic/pangalactic/enterprise/acu.py:1.11 --- PanGalactic/pangalactic/enterprise/acu.py:1.10 Wed May 19 02:50:11 2004 +++ PanGalactic/pangalactic/enterprise/acu.py Sun Aug 8 21:35:39 2004 @@ -1,4 +1,4 @@ -# $Id: acu.py,v 1.10 2004/05/19 06:50:11 waterbug Exp $ +# $Id: acu.py,v 1.11 2004/08/09 01:35:39 waterbug Exp $ """ Assembly Component Usage (ACU) @@ -7,22 +7,14 @@ I{component}) and another Model (the I{assembly}) of which it is a constituent part. -@version: $Revision: 1.10 $ +@version: $Revision: 1.11 $ """ -__version__ = "$Revision: 1.10 $"[11:-2] +__version__ = "$Revision: 1.11 $"[11:-2] -from pangalactic.utils import oid from pangalactic.enterprise.pgefobject import PgefObject -from pangalactic.enterprise.model import Model - -def FillSampleAcu(acu): - """ - Fill in some test data. - """ - acu.pgef_oid = '12345' - acu.assembly_oid = 'honking_module' - acu.component_oid = 'honker' +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Acu(PgefObject): """ @@ -30,59 +22,77 @@ I{component}) and another Model (the I{assembly}) of which it is a constituent part. """ - # _excluded_fields are those inherited from PgefObject - _fk = { - '_assembly' : 'assembly_oid', - '_component' : 'component_oid' - } - - _pk = ['pgef_oid'] + _default_display_order = ["assembly", + "component", + "owner", + "creator", + "ref_designator"] + _default_display_names = {"assembly" : "Assembly", + "component" : "Component", + "owner" : "Owner", + "creator" : "Creator", + "ref_designator" : "Ref. Designator"} _properties = PgefObject._properties.copy() - _schema = PgefObject._schema.copy() - _schema_ext = { - 'assembly_oid' : 'str', - 'component_oid' : 'str', - 'ref_designator' : 'str' - } - _schema.update(_schema_ext) - _required = ['assembly_oid', 'component_oid'] - # Attributes that point to application objects ... this info - # is used by the registry and the PgerObjectFactory. - _refs = PgefObject._refs.copy() - _refs_ext = {'_assembly' : 'Model', - '_component' : 'Model'} - _refs.update(_refs_ext) - # Standard abbreviation for the class name (used in the - # registry to compute the names of foreign key constraints) - _std_abbrev = 'acu' - pgef_class = 'Acu' - - _default_display_order = ["_assembly", "_component", "owner_oid", "creator_oid", "ref_designator"] - _default_display_names = {"_assembly": "Assembly", - "_component": "Component", - "owner_oid": "Owner", - "creator_oid": "Creator", - "ref_designator": "Ref. Designator"} + _required = ['assembly', 'component'] + _schema = OntoClass( + id='Acu', + id_context='PanGalactic', + name='Assembly Component Usage', + abbrev='acu', + base=PgefObject._schema, + description=""" + Acu stands for "Assembly Component Usage", and this Class + maps to STEP assembly_component_usage. + *** Note that the objects in this relationship are + Models, not Parts. *** + + Some STEP subtypes of Acu are: + + Mfuo ... MakeFromUsageOption + Nauo ... NextAssemblyUsageOccurrence + Shuo ... SpecifiedHigherUsageOccurrence + Puo .... PromissoryUsageOccurrence + Quo .... QuantifiedUsageOccurrence + + These may be implemented as OntoClass subtypes of Acu. + """, + properties=[ + OntoProperty( + id='assembly', + id_context='PanGalactic', + name='Assembly', + pgef_datatype='Model', + property_type='object', + min_cardinality=1, + description=""" + The Model in which the component appears as a + part. + """), + OntoProperty( + id='component', + id_context='PanGalactic', + name='Component', + pgef_datatype='Model', + property_type='object', + min_cardinality=1, + description=""" + The Model in the construction of which the component + is used. + """), + OntoProperty( + id='ref_designator', + id_context='PanGalactic', + name='Reference Designator', + pgef_datatype='str', + description=""" + A symbolic name that serves as an identifier for this + component usage within the assembly. + """) + ]) # end of _schema - def __init__(self, _assembly=None, _component=None, **kw): + def __init__(self, **kw): """ Initialize an Acu object. - - @type _assembly: L{pangalactic.enterprise.model.Model} - @param _assembly: the product in which the I{component} - occurs as a part - - @type _component: L{pangalactic.enterprise.model.Model} - @param _component: the product that occurs as a part in - the I{assembly} - - @param kw: optional keyword args """ PgefObject.__init__(self, **kw) - self._assembly = _assembly - self._component = _component - if self._assembly: - self.assembly_oid = self._assembly.pgef_oid - if self._component: - self.component_oid = self._component.pgef_oid Index: PanGalactic/pangalactic/enterprise/project.py diff -u PanGalactic/pangalactic/enterprise/project.py:1.23 PanGalactic/pangalactic/enterprise/project.py:1.24 --- PanGalactic/pangalactic/enterprise/project.py:1.23 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/enterprise/project.py Sun Aug 8 21:35:39 2004 @@ -1,57 +1,73 @@ -# $Id: project.py,v 1.23 2004/06/15 05:32:35 waterbug Exp $ +# $Id: project.py,v 1.24 2004/08/09 01:35:39 waterbug Exp $ """ A specific, identifiable activity of Organizations and Persons. -@version: $Revision: 1.23 $ +@version: $Revision: 1.24 $ """ -__version__ = "$Revision: 1.23 $"[11:-2] +__version__ = "$Revision: 1.24 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject - - -def FillSampleProject(proj): - """ - Fills in some test data. - """ - proj.name = 'TP' - proj.short_description = 'Test Project' - +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Project(PgefObject): """ A specific, identifiable activity of Organizations and Persons. """ - # These are fields that are excluded from copying or - # comparisions between Project objects - _excluded_fields = ['create_datetime', - 'pger_create_datetime', - 'pgef_oid'] - _fk = {} - # These are the fields that will appear in when a Project is - # placed in a grid. - - _default_display_order = ["id", "name", "owner_oid", "short_description", "create_datetime", "creator_oid"] + _default_display_order = ["id", + "name", + "owner", + "description", + "create_datetime", + "creator"] _default_display_names = {"id": "Project Acronym", "name": "Project Name", - "owner_oid": "POC", - "short_description": "Description", + "owner": "POC", + "description": "Description", "create_datetime": "Created", - "creator_oid": "Creator"} - - _pk = ['id', 'id_context'] - _schema_ext = {} - _schema = _schema_ext.copy() - _schema.update(PgefObject._schema) - _refs = {} + "creator": "Creator"} + _excluded_fields = ['create_datetime', + 'pger_create_datetime', + 'pgef_oid'] # These are the minimum fields that must be filled in before # a Project can be saved. _required = ['name', 'id', 'id_context'] - # Standard abbreviation for the class name (used in the - # registry to compute the names of foreign key constraints) - _std_abbrev = 'project' - pgef_class = 'Project' + _schema = OntoClass( + id='Project', + id_context='PanGalactic', + name='Project', + abbrev = 'proj', + base=PgefObject._schema, + description=""" + A specific, identifiable activity of Organizations and + Persons. + """, + properties=[ + OntoProperty( + id='org_roles', + id_context='PanGalactic', + name='Organization Roles', + pgef_datatype='Organization', + property_type='object', + min_cardinality=0, + max_cardinality=0, + description=""" + Organizations involved in the Project and their Roles. + """), + OntoProperty( + id='person_roles', + id_context='PanGalactic', + name='Person Roles', + pgef_datatype='PersonRole', + property_type='object', + min_cardinality=0, + max_cardinality=0, + description=""" + Persons involved in the Project and their Roles. + """) + ]) # end of _schema def __init__(self, **kw): PgefObject.__init__(self, **kw) Index: PanGalactic/pangalactic/enterprise/model.py diff -u PanGalactic/pangalactic/enterprise/model.py:1.9 PanGalactic/pangalactic/enterprise/model.py:1.10 --- PanGalactic/pangalactic/enterprise/model.py:1.9 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/enterprise/model.py Sun Aug 8 21:35:39 2004 @@ -1,102 +1,128 @@ -# $Id: model.py,v 1.9 2004/06/15 05:32:35 waterbug Exp $ +# $Id: model.py,v 1.10 2004/08/09 01:35:39 waterbug Exp $ """ A representation or specification of a thing. -@version: $Revision: 1.9 $ +@version: $Revision: 1.10 $ """ -__version__ = "$Revision: 1.9 $"[11:-2] +__version__ = "$Revision: 1.10 $"[11:-2] -from pangalactic.enterprise.project import Project from pangalactic.enterprise.versionedobject import VersionedObject -from pangalactic.enterprise.part import Part -from pangalactic.utils import pgefexceptions -from pangalactic.utils.utils import compareSequence1 - +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Model(VersionedObject): """ - A representation or specification of a thing (the thing may + A representation or specification of a Thing (the Thing may or may not be a Part). """ - - # These are fields that are excluded from copying or - # comparisions between Model objects - _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] - _fk = VersionedObject._fk.copy() - _fk_ext = { - '_of_part' : 'of_part_oid' - } - _fk.update(_fk_ext) - - # These are the fields that will appear in when an item is - # placed in a grid. - _default_display_order = ["id", "name", "short_description", "owner_oid"] + _default_display_order = ["id", "name", "description", "owner"] _default_display_names = {"id": "Model", "name": "Model Name Code", - "short_description": "Model Name", - "owner_oid": "Model Owner"} + "description": "Model Name", + "owner": "Model Owner"} _default_display_types = {} -# _gridmap = [ -# ['Part\nNumber', 'self._of_part.id', 'string'], -# ['Model', 'self.id', 'string'], -# ['Model\nName\nCode', 'self.name', 'string'], -# ['Model\nName', 'self.short_description', 'string'], -# ['Model\nOwner', 'self.owner_oid', 'string'] -# ] - # _required specifies the minimum fields that must be filled - # in before a Model can be saved. + _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] _required = ['id', 'name'] - # Intrinsic attributes that point to application objects ... - # this info is used by the registry and - # PgerObjectFactory. - _refs = VersionedObject._refs.copy() - _refs_ext = { - '_of_part' : 'Part' - } - _refs.update(_refs_ext) - # Standard abbreviation for the class name (used in the - # registry to compute the names of foreign key - # constraints) - _schema = VersionedObject._schema.copy() - _schema_ext = { - 'model_view' : 'str', - 'frame_of_reference' : 'str', - 'definition_context' : 'str', - 'life_cycle_stage' : 'str', - 'has_docs_flag' : 'bool', - 'has_parts_flag' : 'bool', - 'has_parts_lists_flag' : 'bool', - 'of_part_oid' : 'str' - } - _schema.update(_schema_ext) - _std_abbrev = 'm' - pgef_class = 'Model' + _schema = OntoClass( + id='Model', + id_context='PanGalactic', + name='Model', + abbrev='m', + base=VersionedObject._schema, + description=""" + A Model is any representation of some set of + characteristics of a product concept. A Model itself can + be considered a product (therefore the characteristics of + any Model are a possible subject of another level of + Model, sometimes refer to as a "meta-model" relative to + the Model that it models). A Model can be versioned. + PGEF Model maps to the STEP (ISO 10303) concept called + 'product_definition'. + """, + properties=[ + OntoProperty( + id='model_view', + id_context='PanGalactic', + name='Model View', + pgef_datatype='str', + description=""" + Allowed values are: + 'design' ... STEP AP210 design view + 'usage' .... STEP AP210 usage view + 'build' .... supports physical assembly, etc. + """), # TODO: provide the AP210 definitions of these + OntoProperty( + id='frame_of_reference', + id_context='PanGalactic', + name='Frame of Reference', + pgef_datatype='str', + description=""" + 'frame_of_reference' could be thought of as the + activity or context that produced and uses the Model + -- which also defines its point of view. In STEP, + this maps to 'pd.frame_of_reference.application'. In + STEP, f_o_r points to an application_context, which + refers to the general application domain that defined + the data ... the values recommended in the PDM Schema + Usage Guide are: 'digital mock up' 'assembly study' + 'process planning' 'electrical design' 'mechanical + design', but a set of values meaningful within the + context of a Project or Organization should be + defined for this attribute to be useful. + """), + OntoProperty( + id='definition_context', + id_context='PanGalactic', + name='Definition Context', + pgef_datatype='str', + description=""" + Maps to STEP 'product_definition_context.name'. From + the STEP PDM Schema Usage Guide: "Distinguishes the + type of the associated product_definition ...". + Examples given in the STEP PDM Schema Usage Guide all + use name = 'part definition' ... a set of values + meaningful within the context of a Project or + Organization should be defined for this attribute to + be useful. + """), + OntoProperty( + id='life_cycle_stage', + id_context='PanGalactic', + name='Life Cycle Stage', + pgef_datatype='str', + description=""" + PGEF 'life_cycle_stage' is equivalent to STEP + 'product_definition_context.life_cycle_stage'. The + two values recommended in the STEP PDM Schema Usage + Guide are: 'design' and 'manufacturing' ... a set of + values meaningful within the context of a Project or + Organization should be defined for this attribute to + be useful. + """), + OntoProperty( + id='of_part', + id_context='PanGalactic', + name='Modeled Part', + pgef_datatype='Part', + property_type='object', + description=""" + The Part that the Model represents. + """) + ]) # end of _schema - def __init__(self, _project='NOPROJECT', _of_part=None, **kw): + def __init__(self, **kw): """ Initialize a Model object. - @type _project: L{pangalactic.enterprise.project.Project} - @param _project: the Project that "owns" the Model - - @type _of_part: L{pangalactic.enterprise.part.Part} - @param _of_part: the Part that the Model represents - (optional!) - - @param kw: optional keyword args (can be any - attribute in Model._schema) + @type of_part: L{pangalactic.enterprise.part.Part} + @param of_part: the Part that the Model represents + (optional!) """ VersionedObject.__init__(self, **kw) - self._project = _project - self._of_part = _of_part - if self._of_part: - self.of_part_oid = self._of_part.pgef_oid - # inherit project only if I didn't get one from init - if self._project == 'NOPROJECT': - self._project = self._of_part._project - self.project_oid = self._of_part.project_oid - self._display_map = self.getDisplayMap() - + # inherit project from 'of_part' only if I didn't get one + # from init + if not self.project and self.of_part: + self.project = getattr(self.of_part, 'project', None) Index: PanGalactic/pangalactic/enterprise/dcu.py diff -u PanGalactic/pangalactic/enterprise/dcu.py:1.11 PanGalactic/pangalactic/enterprise/dcu.py:1.12 --- PanGalactic/pangalactic/enterprise/dcu.py:1.11 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/enterprise/dcu.py Sun Aug 8 21:35:39 2004 @@ -1,4 +1,4 @@ -# $Id: dcu.py,v 1.11 2004/06/15 05:32:35 waterbug Exp $ +# $Id: dcu.py,v 1.12 2004/08/09 01:35:39 waterbug Exp $ """ Document Component Usage (DCU) @@ -7,13 +7,14 @@ I{component}) and another Document (the I{assembly}) in which it occurs as a part. -@version: $Revision: 1.11 $ +@version: $Revision: 1.12 $ """ -__version__ = "$Revision: 1.11 $"[11:-2] +__version__ = "$Revision: 1.12 $"[11:-2] -from pangalactic.enterprise.document import Document from pangalactic.enterprise.pgefobject import PgefObject +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Dcu(PgefObject): """ @@ -23,52 +24,56 @@ I{component}) and another Document (the I{assembly}) in which it occurs as a part. """ - # _excluded_fields are those inherited from PgefObject - _fk = { - '_assembly' : 'assembly_oid', - '_component' : 'component_oid' - } - _pk = ['pgef_oid'] + _schema = OntoClass( + id='Dcu', + id_context='PanGalactic', + name='Document Component Usage', + abbrev='dcu', + base=PgefObject._schema, + description=""" + A DocumentComponentUsage (DCU) is an occurrence of a + Document as a "component" (e.g., a chapter, a table, a + "node" [as in XML node], an attachment, etc.) within + another Document. + """, + properties=[ + OntoProperty( + id='assembly', + id_context='PanGalactic', + name='Assembly', + pgef_datatype='Document', + property_type='object', + min_cardinality=1, + description=""" + The Document in which the component appears as a + part."""), + OntoProperty( + id='component', + id_context='PanGalactic', + name='Component', + pgef_datatype='Document', + property_type='object', + min_cardinality=1, + description=""" + The Document in the construction of which the + component is used."""), + OntoProperty( + id='ref_designator', + id_context='PanGalactic', + name='Reference Designator', + pgef_datatype='str', + description=""" + A reference designator should be an identifier that + is unique within the local Document's name space, and + could be used to order attachments, for example.""") + ]) # end of _schema + _properties = PgefObject._properties.copy() - _refs = {'_assembly' : 'Document', - '_component' : 'Document'} _required = [] - _schema_ext = { - 'assembly_oid' : 'str', - 'component_oid' : 'str', - 'ref_designator' : 'str' - } - _schema = _schema_ext.copy() - _schema.update(PgefObject._schema) - _std_abbrev = 'dcu' - pgef_class = 'Dcu' - def __init__(self, _assembly=None, _component=None, **kw): + def __init__(self, **kw): """ Initialize a Dcu object. - - I{Note: if the _assembly and _component Model objects are - not passed in, then the following keyword arguments are - required}: - - assembly_oid (the pgef_oid of the assembly) - - component_oid (the pgef_oid of the component) - other recognized kw args for Dcu are: - - name - - ref_designator - - @type _assembly: L{pangalactic.enterprise.document.Document} - @param _assembly: the Document in which the I{component} occurs as a part - - @type _component: L{pangalactic.enterprise.document.Document} - @param _component: the Document that occurs as a part in the I{assembly} - - @param kw: optional keyword args """ PgefObject.__init__(self, **kw) - self._assembly = _assembly - self._component = _component - if self._assembly: - self.assembly_oid = self._assembly.pgef_oid - if self._component: - self.component_oid = self._component.pgef_oid Index: PanGalactic/pangalactic/enterprise/versionedobject.py diff -u PanGalactic/pangalactic/enterprise/versionedobject.py:1.13 PanGalactic/pangalactic/enterprise/versionedobject.py:1.14 --- PanGalactic/pangalactic/enterprise/versionedobject.py:1.13 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/enterprise/versionedobject.py Sun Aug 8 21:35:39 2004 @@ -1,74 +1,93 @@ -# $Id: versionedobject.py,v 1.13 2004/06/15 05:32:35 waterbug Exp $ +# $Id: versionedobject.py,v 1.14 2004/08/09 01:35:39 waterbug Exp $ """ A thing which evolves in a set of discrete, identified incarnations. """ -__version__ = "$Revision: 1.13 $"[11:-2] +__version__ = "$Revision: 1.14 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject -from pangalactic.enterprise.project import Project +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class VersionedObject(PgefObject): """ A thing which evolves in a set of discrete, identified incarnations. """ - # NOTE: '_contains' has been deactivated indefinitely - # _contains = {} - # _contains_methods = {} - - # These are fields that are excluded from copying or - # comparisions between ProductMaster Objects - _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] - _fk = { - '_project' : 'project_oid' - } - - _schema_ext = { - 'base_id' : 'str', - 'iteration' : 'int', - 'version' : 'str', - 'head_flag' : 'bool', - 'project_oid' : 'str' - } - _schema = _schema_ext.copy() - _schema.update(PgefObject._schema) - # Attributes that point to application objects ... this info - # is used by the registry and the PgerObjectFactory. - _refs = {'_project' : 'Project'} - # _required specifies the minimum fields that must be filled - # in before a ProductMaster can be saved. + _excluded_fields = ['create_datetime', + 'pger_create_datetime', + 'pgef_oid'] _required = [] - # Standard abbreviation for the class name (used in the - # registry to compute the names of foreign key constraints) - _std_abbrev = 'vo' + _schema = OntoClass( + id='VersionedObject', + id_context='PanGalactic', + name='Versioned Object', + abbrev='vo', + base=PgefObject._schema, + description=""" + VersionedObject is the supertype of all PGEF objects that are to be + versioned within the context of a PGEF application. + VersionedObject supports, but does not require, strict + configuration management. + """, + properties=[ + OntoProperty( + # TODO: probably need to add a namespace for this + id='base_id', + id_context='PanGalactic', + name='Base ID', + pgef_datatype='str', + description=""" + Objects that are versions of the same thing have the same + base_id. + """), + OntoProperty( + id='iteration', + id_context='PanGalactic', + name='Iteration', + pgef_datatype='int', + default='0', + description=""" + An application-assigned sequential integer identifying the + precedence order of revisions of the object. + """), + OntoProperty( + id='version', + id_context='PanGalactic', + name='Version', + pgef_datatype='str', + description=""" + A user-modifiable string used to identify a baseline, release, + or version. + """), + OntoProperty( + id='is_head', + id_context='PanGalactic', + name='HEAD', + pgef_datatype='bool', + default='True', + description=""" + This flag is set to True for a VersionedObject committed as a + new version (and unset on the previous head VersionedObject + that has the same base_id). + """), + OntoProperty( + id='project', # TODO: should probably be 'projects' + id_context='PanGalactic', + name='Project', + pgef_datatype='Project', + property_type='object', + description=""" + The Project under which the Part was created (if applicable -- + if not applicable, the defaults are used). + """) + ]) # end of _schema def __init__(self, **kw): """ - Initialize - - id must be unique within the id_context - (default is a draft part number based on user's id - and project) - - id_context must be a valid id_context - (default is the user's organization identifier) - - other recognized kw args are: - - _project (a Project object) - - any schema attribute + Initialize a VersionedObject. """ PgefObject.__init__(self, **kw) - self._project = kw.get('_project', None) - if self._project: - self.project_oid = self._project.pgef_oid - - def popTestData(self): - """ - Populate an instance's unpopulated attributes with some - test data. - """ - PgefObject.popTestData(self) - self.name = self.name or 'Test Object' - self.short_description = (self.short_description or - 'This is a test object') Index: PanGalactic/pangalactic/enterprise/person.py diff -u PanGalactic/pangalactic/enterprise/person.py:1.21 PanGalactic/pangalactic/enterprise/person.py:1.22 --- PanGalactic/pangalactic/enterprise/person.py:1.21 Wed Jun 2 17:05:20 2004 +++ PanGalactic/pangalactic/enterprise/person.py Sun Aug 8 21:35:39 2004 @@ -1,19 +1,24 @@ -# $Id: person.py,v 1.21 2004/06/02 21:05:20 pbear Exp $ +# $Id: person.py,v 1.22 2004/08/09 01:35:39 waterbug Exp $ """ A human being. """ from pangalactic.enterprise.pgefobject import PgefObject -from pangalactic.enterprise.organization import Organization +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Person(PgefObject): """ - A human being (who may or may not be a PGEF application - user). + A human being (who may or may not be a PanGalactic + application user). """ - _excluded_fields = [] - _default_display_order = ["lname", "fname", "mi_or_name", "pgef_oid", "position_title", "enabled_flag"] + _default_display_order = ["lname", + "fname", + "mi_or_name", + "pgef_oid", + "position_title", + "enabled_flag"] _default_display_names = {"lname" : "Last Name", "fname" : "First Name", "mi_or_name" : "M.I./Name", @@ -21,34 +26,122 @@ "position_title" : "Title/Position", "enabled_flag": "Enabled"} _default_display_types = {} + _excluded_fields = [] _properties = PgefObject._properties.copy() _required = ['id', 'fname', 'lname', 'email', 'phone'] - _refs = {'_org' : 'Organization'} - _schema_ext = { - 'email' : 'str', - 'fname' : 'str', - 'mi_or_name' : 'str', - 'lname' : 'str', - 'position_title' : 'str', - 'org_oid' : 'str', - 'x500_number' : 'str', - 'phone' : 'str', - 'enabled_flag' : 'bool', - 'god_flag' : 'bool' - } - - _schema = PgefObject._schema.copy() - _schema.update(_schema_ext) - _std_abbrev = 'person' - pgef_class = 'Person' + _schema=OntoClass( + id='Person', + id_context='PanGalactic', + name='Person', + abbrev='person', + base=PgefObject._schema, + description=""" + [STEP: person_organization]. A PGEF Person can be (1) a + specific person affiliated with an organization + (optionally, with a role specified), (2) just a role and + an organization, without a person specified. A Person + representing the owner of something can have either of + these manifestations. + """, + properties=[ + OntoProperty( + id='email', + id_context='PanGalactic', + name='Email', + pgef_datatype='str', + description=""" + The email address of the Person. + """), + OntoProperty( + id='fname', + id_context='PanGalactic', + name='First Name', + pgef_datatype='str', + description=""" + The Person's first (given) name. + """), + OntoProperty( + id='mi_or_name', + id_context='PanGalactic', + name='Middle Initial or Name', + pgef_datatype='str', + description=""" + The Person's middle initial or name. + """), + OntoProperty( + id='lname', + id_context='PanGalactic', + name='Last Name', + pgef_datatype='str', + description=""" + The Person's last name (surname). + """), + OntoProperty( + id='position_title', + id_context='PanGalactic', + name='Position Title', + pgef_datatype='str', + description=""" + The Person's position or title in the organization. + """), + OntoProperty( + id='org', + id_context='PanGalactic', + name='Organization', + pgef_datatype='Organization', + property_type='object', + description=""" + The Person's primary organization. + """), + OntoProperty( + id='x500_number', + id_context='PanGalactic', + name='X500 Number', + pgef_datatype='str', + default='1', + description=""" + The Person's X.500 numeric "discriminator" attribute, + appended to their name to make it unique within the + directory. + """), + OntoProperty( + id='phone', + id_context='PanGalactic', + name='Phone', + pgef_datatype='str', + description=""" + The Person's telephone number at their + organization. + """), + OntoProperty( + id='enabled', + id_context='PanGalactic', + name='Enabled', + pgef_datatype='bool', + default='False', + description=""" + A boolean indicating whether the Person's PGEF userid + is enabled or not. If not, they are denied login + access. + """), + OntoProperty( + id='god', + id_context='PanGalactic', + name='god', + pgef_datatype='bool', + default='False', + description=""" + A boolean indicating whether the Person has the + capability to assign any role to themselves. + """) + ]) # end of _schema def __init__(self, **kw): PgefObject.__init__(self, **kw) - self.enabled = kw.get("enabled", False) self._password = kw.get('_password', '') self._loggedin = kw.get('_loggedin', False) self._pending_operations = kw.get('_pending_operations', []) Index: PanGalactic/pangalactic/enterprise/partslist.py diff -u PanGalactic/pangalactic/enterprise/partslist.py:1.22 PanGalactic/pangalactic/enterprise/partslist.py:1.23 --- PanGalactic/pangalactic/enterprise/partslist.py:1.22 Thu Jul 15 15:14:49 2004 +++ PanGalactic/pangalactic/enterprise/partslist.py Sun Aug 8 21:35:39 2004 @@ -1,81 +1,87 @@ -# $Id: partslist.py,v 1.22 2004/07/15 19:14:49 pbear Exp $ +# $Id: partslist.py,v 1.23 2004/08/09 01:35:39 waterbug Exp $ """ -A Document consisting of a collection of Part references and +A Document consisting of a collection of references to Parts and associated data. """ -__version__ = "$Revision: 1.22 $"[11:-2] +__version__ = "$Revision: 1.23 $"[11:-2] from pangalactic.enterprise.document import Document +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class PartsList(Document): """ - A Document consisting of a collection of Part references and - associated data. + A Document consisting of a collection of references to Parts + and associated data. """ - # NOTE: '_contains' has been deactivated indefinitely - # _contains = Document._contains.copy() - _excluded_fields = [] - _fk = {} - - _default_display_order = ["id", "owner_oid", "version"] + _default_display_order = ["id", "owner", "version"] _default_display_names = {"id": "Parts List ID", - "owner_oid": "Point of Contact", + "owner": "Point of Contact", "version": "Version"} - _properties = { - 'PointofContact' : 'str', + _excluded_fields = [] + _properties = {'PointofContact' : 'str', 'Identifier' : 'str', - 'Type' : 'str' - } - _refs = Document._refs.copy() - _required = [ - 'PointofContact', - 'Identifier' - ] - _schema = Document._schema.copy() - _schema_ext = { - 'parent_oid' : 'str', - 'part_oid' : 'str' - } - _schema.update(_schema_ext) - _std_abbrev = 'pl' - pgef_class = 'PartsList' + 'Type' : 'str'} + _required = ['PointofContact', + 'Identifier'] + _schema = OntoClass( + id='PartsList', + id_context='PanGalactic', + name='Parts List', + abbrev='pl', + base=Document._schema, + description=""" + A PGEF PartsList is simply a documented collection of + parts and related information. Parts lists are used in + various contexts in the product life cycle, e.g.: to + document component technology research, to document + candidate parts for assemblies, to document parts used in + model development, to track parts procurement + information, to document part stocks and inventory, etc. + """, + properties=[ + OntoProperty( + id='pl_type', + id_context='PanGalactic', + name='Parts List Type', + pgef_datatype='str', + description=""" + The type of the PartsList, selected from a set of + standard parts list types, such as 'as-designed' + (ADPL), 'as-built' (ABPL), 'preliminary' (PRPL), + etc., which should be agreed upon by the Project(s) + or Organization(s) using the PartsList. + """), + OntoProperty( + id='status', + id_context='PanGalactic', + name='Status', + pgef_datatype='str', + description=""" + The state of the PartsList relative to some possibly + extensible set of standard states, e.g. 'in-process', + 'reviewed', etc. The set of standard states should + be agreed upon by the Project(s) or Organization(s) + using the PartsList. + """), + OntoProperty( + id='parts', + id_context='PanGalactic', + name='Parts', + pgef_datatype='Part', + property_type='object', + min_cardinality=1, + max_cardinality=0, + description=""" + The Parts referenced by the PartsList. + """) + ]) # end of _schema def __init__(self, **kw): """ Initialize a PartsList object. """ Document.__init__(self, **kw) - self._ColumnMapping = {} - self._ColumnMappingID = -1 - self._ColumnInfo = {} - - - def deleteAttr(self): - raise TypeError, 'Cannot delete attribute' - - def getPointofContact(self): - return self.owner_oid - - def setPointofContact(self, value): - self.__dict__['owner_oid'] = value - - PointofContact = property(getPointofContact, - setPointofContact, - deleteAttr, - 'PointofContact') - _properties["PointofContact"] = "str" - - def getIdentifier(self): - return self.id - - def setIdentifier(self, value): - self.__dict__['id'] = value - - Identifier = property(getIdentifier, - setIdentifier, - deleteAttr, - 'Identifier') - _properties["Identifier"] = "str" Index: PanGalactic/pangalactic/enterprise/part.py diff -u PanGalactic/pangalactic/enterprise/part.py:1.8 PanGalactic/pangalactic/enterprise/part.py:1.9 --- PanGalactic/pangalactic/enterprise/part.py:1.8 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/enterprise/part.py Sun Aug 8 21:35:39 2004 @@ -1,108 +1,295 @@ -# $Id: part.py,v 1.8 2004/06/15 05:32:35 waterbug Exp $ +# $Id: part.py,v 1.9 2004/08/09 01:35:39 waterbug Exp $ """ -A product or some specifiable thing. +A Part is a product or some specifiable thing. + +The Part object encapsulates data pertaining to design, +specification, or description. It may be versioned. """ -__version__ = "$Revision: 1.8 $"[11:-2] +__version__ = "$Revision: 1.9 $"[11:-2] -from pangalactic.enterprise.project import Project from pangalactic.enterprise.versionedobject import VersionedObject +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Part(VersionedObject): """ - I encapsulate data pertaining to the design, specification, - or description of a product or some specifiable thing. I may - be versioned. + A Part is a product or some specifiable thing. + + The Part object encapsulates data pertaining to design, + specification, or description. It may be versioned. """ - # These are fields that are excluded from copying or - # comparisions between Part objects - _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] # These are the fields that will appear in when an item is placed in a grid. # The format for each field is [ Label, attribute, field_type ]. _default_display_order = ["id", "name", - "owner_oid", - "short_description", + "owner", + "description", "create_datetime", - "creator_oid"] + "creator"] _default_display_names = {"id": "Part Number", - "name": "Name Code", - "owner_oid": "POC", - "short_description": "Name", + "name": "Name", + "owner": "POC", + "description": "Description", "create_datetime": "Created", - "creator_oid": "Creator"} + "creator": "Creator"} _default_display_types = {} + _excluded_fields = ['create_datetime', + 'pger_create_datetime', + 'pgef_oid'] + _required = ['id', + 'id_context'] + _schema = OntoClass( + id='Part', + id_context='PanGalactic', + abbrev='pt', + base=VersionedObject._schema, + description=""" + Part represents an identifiable, specifiable product or + thing. The PGEF Part concept maps to the combination of + STEP (ISO 10303) 'product' and + 'product_definition_formation' - _fk = VersionedObject._fk.copy() - _refs = VersionedObject._refs.copy() - # _required specifies the minimum fields - _required = [ - 'id', - 'id_context' - ] - _schema = VersionedObject._schema.copy() - _schema_ext = { - 'part_number_spec' : 'str', - 'part_number_generic' : 'str', - 'part_number_mfr' : 'str', - 'part_number_nsn' : 'str', - 'model_number' : 'str', - 'drawing_number' : 'str', - 'mfr' : 'str', - 'mfr_name_code' : 'str', - 'vendor' : 'str', - 'vendor_name_code' : 'str', - 'fsc_code' : 'str', - 'type_designator' : 'str', - 'package_type' : 'str', - 'specification' : 'str', - 'military_specification' : 'str', - 'military_standard' : 'str', - 'screening_spec' : 'str', - 'lot_date_codes' : 'str', - 'lot_date_code_start' : 'str', - 'lot_date_code_end' : 'str', - 'quantity' : 'int', - 'serial_number' : 'str', - 'ref_designator' : 'str', - 'change_flag' : 'bool', - 'validated_flag' : 'bool', - 'has_docs_flag' : 'bool' - } - _schema.update(_schema_ext) - # Standard abbreviation for the class name (used in the - # registry to compute the names of foreign key constraints) - _std_abbrev = 'pt' - pgef_class = 'Part' + More mapping notes: STEP 'frame_of_reference' (-> + product_context.id) is not represented within the PGEF + ontology. STEP 'description' maps to description. + """, + properties=[ + OntoProperty( + id='part_number_spec', + id_context='PanGalactic', + name='Specification Part Number', + pgef_datatype='str', + description=""" + The identifier for the Part given by its + specification. + """), + OntoProperty( + id='part_number_generic', + id_context='PanGalactic', + name='Generic Part Number', + pgef_datatype='str', + description=""" + The generic identifier for the Part, which in some + cases is specified by a standard (e.g., JEDEC for + electronic parts). + """), + OntoProperty( + id='part_number_mfr', + id_context='PanGalactic', + name='Manufacturer Part Number', + pgef_datatype='str', + description=""" + The manufacturer's identifier for the Part. + """), + OntoProperty( + id='part_number_nsn', + id_context='PanGalactic', + name='National Stock Number', + pgef_datatype='str', + description=""" + The National Stock Number for the Part. + """), + OntoProperty( + id='part_number_xref', + id_context='PanGalactic', + name='Cross-Reference Part Number', + pgef_datatype='str', + description=""" + An alias part number for this part. + """), + OntoProperty( + id='model_number', + id_context='PanGalactic', + name='Model Number', + pgef_datatype='str', + description=""" + The identifier for the Part's 'model', a somewhat + arbitrary identifier usually specified by the + manufacturer. + """), + OntoProperty( + id='drawing_number', + id_context='PanGalactic', + name='Drawing Number', + pgef_datatype='str', + description=""" + If the Part has a 'drawing' (a type of + specification), this is its identifier. + """), + OntoProperty( + id='mfr', + id_context='PanGalactic', + name='Manufacturer', + pgef_datatype='str', + description=""" + The CAGE Code of the Organization's plant or location + where the Part was manufactured. + """), + OntoProperty( + id='mfr_name_code', + id_context='PanGalactic', + name='Manufacturer Name Code', + pgef_datatype='str', + description=""" + A standard abbreviation for the parent Organization + of the plant or location where the Part was + manufactured. + """), + OntoProperty( + id='vendor', + id_context='PanGalactic', + name='Vendor', + pgef_datatype='str', + description=""" + The CAGE Code of the Organization's plant or location + from which the Part was procured. + """), + OntoProperty( + id='vendor_name_code', + id_context='PanGalactic', + name='Vendor Name Code', + pgef_datatype='str', + description=""" + A standard abbreviation for the parent Organization + of the plant or location from which the Part was + procured. + """), + OntoProperty( + id='fsc_code', + id_context='PanGalactic', + name='FSC Code', + pgef_datatype='str', + description=""" + The Federal Supply Classification code for the + Part (this is also the first four digits of the + NSN). + """), + OntoProperty( + id='type_designator', + id_context='PanGalactic', + name='Type Designator', + pgef_datatype='str', + description=""" + A classifier for the Part. + """), + OntoProperty( + id='package_type', + id_context='PanGalactic', + name='Package Type', + pgef_datatype='str', + description=""" + A standard identifier for the Part's package. + """), + OntoProperty( + id='specification', + id_context='PanGalactic', + name='Specification', + pgef_datatype='str', + description=""" + The name or identifier of the formal specification to + which the Part was procured. + """), + OntoProperty( + id='military_specification', + id_context='PanGalactic', + name='Military Specification', + pgef_datatype='str', + description=""" + The identifier of the military specification to which + the Part was procured. + """), + OntoProperty( + id='military_standard', + id_context='PanGalactic', + name='Military Standard', + pgef_datatype='str', + description=""" + The identifier of a military standard to which the + Part conforms. + """), + OntoProperty( + id='screening_spec', + id_context='PanGalactic', + name='Screening Specification', + pgef_datatype='str', + description=""" + The specification to which any screening of the Part + was or is to be performed. + """), + OntoProperty( + id='lot_date_codes', + id_context='PanGalactic', + name='Lot Date Codes', + pgef_datatype='str', + description=""" + Dates of manufacture of the lots that included this + Part instance (applicable only to physical Part + instances). + """), + OntoProperty( + id='lot_date_code_start', + id_context='PanGalactic', + name='Lot Date Code Start', + pgef_datatype='str', + description=""" + Earliest lot_date_code of the lots that included this + Part instance (applicable only to physical Part + instances). + """), + OntoProperty( + id='lot_date_code_end', + id_context='PanGalactic', + name='Lot Date Code End', + pgef_datatype='str', + description=""" + Latest lot_date_code of the lots that included this + Part instance (applicable only to physical Part + instances). + """), + OntoProperty( + id='quantity', + id_context='PanGalactic', + name='Quantity', + pgef_datatype='int', + default='1', + description=""" + Number of instances of this Part (applicable only to + physical Part instances). + """), + OntoProperty( + id='serial_number', + id_context='PanGalactic', + name='Serial Number', + pgef_datatype='str', + description=""" + A unique identifier of a physical Part instance. + """), + OntoProperty( + id='ref_designator', + id_context='PanGalactic', + name='Reference Designator', + pgef_datatype='str', + description=""" + A unique identifier of a usage of this Part + (applicable only to an occurance of a Part in an + assembly). + """), + OntoProperty( + id='is_validated', + id_context='PanGalactic', + name='Validated', + pgef_datatype='bool', + description=""" + A boolean indicating whether the information in this + Part object has been validated. + """) + ]) # end of _schema def __init__(self, **kw): """ - Initialize - - id must be unique within the id_context - (default is a draft part number based on user's id - and project) - - id_context must be a valid id_context - (default is the user's organization identifier) - - other recognized kw args are: - - _project (a Project object) - - name - - has_docs_flag + Initialize a Part object. """ VersionedObject.__init__(self, **kw) - project = getattr(self, '_project', None) - if project: - self.project_oid = project.pgef_oid - self._display_map = self.getDisplayMap() - - - def popTestData(self): - """ - Populate an instance's unpopulated attributes with some - test data. - """ - VersionedObject.popTestData(self) - self.name = self.name or 'Test Part' - self.short_description = (self.short_description or - 'This is a test object') Index: PanGalactic/pangalactic/enterprise/pgeffile.py diff -u PanGalactic/pangalactic/enterprise/pgeffile.py:1.24 PanGalactic/pangalactic/enterprise/pgeffile.py:1.25 --- PanGalactic/pangalactic/enterprise/pgeffile.py:1.24 Mon May 24 13:03:15 2004 +++ PanGalactic/pangalactic/enterprise/pgeffile.py Sun Aug 8 21:35:39 2004 @@ -1,41 +1,140 @@ -# $Id: pgeffile.py,v 1.24 2004/05/24 17:03:15 pbear Exp $ +# $Id: pgeffile.py,v 1.25 2004/08/09 01:35:39 waterbug Exp $ """ -A container for information about a file, including its path. +PgefFile is a logical proxy for a system file, including +information about the file and its location. Note that a system +file may have more than one PgefFile associated with it -- in +general, the PgefFile carries information about the semantics of +the file's relationship to another PgefObject such as a Part, +Model, or Document, and the file may have relationships to more +than one such object. -@version: $Revision: 1.24 $ +@version: $Revision: 1.25 $ """ -__version__ = "$Revision: 1.24 $"[11:-2] +__version__ = "$Revision: 1.25 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class PgefFile(PgefObject): """ - A container for information about a file, including its path. + PgefFile is a logical proxy for a system file, including + information about the file and its location. Note that a + system file may have more than one PgefFile associated with + it -- in general, the PgefFile carries information about the + semantics of the file's relationship to another PgefObject + such as a Part, Model, or Document, and the file may have + relationships to more than one such object. """ - # NOTE: '_contains' has been deactivated indefinitely - # _contains = {} - # _contains_methods = {} _excluded_fields = [] - _schema_ext = { - 'location' : 'str', - 'user_file_name' : 'str', - 'secured_flag' : 'bool', - 'bytes' : 'int', - 'mime_type_oid' : 'str', - 'parent_oid' : 'str', - 'usage' : 'str', - 'role' : 'str', - 'rep_type' : 'str', - 'sequence' : 'int' - } - _schema = _schema_ext.copy() - _schema.update(PgefObject._schema) _required = [] - _refs = {} - _std_abbrev = 'pf' - pgef_class = 'PgefFile' + _schema=OntoClass( + id='PgefFile', + id_context='PanGalactic', + name='File', + abbrev='pf', + base=PgefObject._schema, + description=""" + PgefFile is a logical proxy for a system file, including + information about the file and its location. Note that a + system file may have more than one PgefFile associated + with it -- in general, the PgefFile carries information + about the semantics of the file's relationship to another + PgefObject such as a Part, Model, or Document, and the + file may have relationships to more than one such object. + """, + properties=[ + OntoProperty( + id='role', + id_context='PanGalactic', + name='File Role', + pgef_datatype='str', + description=""" + The purpose or meaning of this particular file -- + e.g. "attachment", "content", "stylesheet", "DTD", + etc. + """), + OntoProperty( + id='sequence', + id_context='PanGalactic', + name='Sequence', + pgef_datatype='int', + description=""" + An integer that can be used to specify the ordering + of this file reference within an ordered set of files + -- attachments, for example. NOTE: 'sequence' is + intepreted as applying within the 'sequence_context'. + """), + OntoProperty( + id='sequence_context', + id_context='PanGalactic', + name='Sequence Context', + pgef_datatype='str', + default='role', + description=""" + The name of the attribute within the context of which + the 'sequence' attribute is meaningful. IOW, if the + 'sequence_context' value is 'role', and the 'role' + value is 'attachment', then 'sequence' is the + position of this file within the set of files that + have a 'role' of 'attachment'. + """), + OntoProperty( + id='location', + id_context='PanGalactic', + name='Location', + pgef_datatype='str', + description=""" + (1) For unsecured files (i.e., those not + "vaulted"/controlled by PGER), location == URL. + (2) For secured files, location will usually be + completely different from a URL (if there even is + one) used by an end-user to obtain the file. It is + the computable path used by PGER to read/write the + file; in the case of a single PGER instance on a + single host, the location is the system path to the + file. The default location is determined by the + vault implementation. + """), + OntoProperty( + id='user_file_name', + id_context='PanGalactic', + name='User File Name', + pgef_datatype='str', + description=""" + The user/owner's local name for the system file. + """), + OntoProperty( + id='is_secured', + id_context='PanGalactic', + name='Secured', + pgef_datatype='bool', + default='True', + min_cardinality=1, + description=""" + If True, the file is secured in PGER's vault; if + False, the file may be anywhere. + """), + OntoProperty( + id='bytes', + id_context='PanGalactic', + name='Bytes', + pgef_datatype='int', + description=""" + The size of the file in bytes. + """), + OntoProperty( + id='mime_type', + id_context='PanGalactic', + name='MIME Type', + pgef_datatype='Mime', + property_type='object', + description=""" + The MIME type of the file's content. + """) + ]) # end of _schema def __init__(self, **kw): """ @@ -43,7 +142,6 @@ """ PgefObject.__init__(self, **kw) self._local_file_name = kw.get("_local_file_name", "") - #self._local_file_name = "" def setLocalFilename(self, fn): self._local_file_name = fn Index: PanGalactic/pangalactic/enterprise/organization.py diff -u PanGalactic/pangalactic/enterprise/organization.py:1.19 PanGalactic/pangalactic/enterprise/organization.py:1.20 --- PanGalactic/pangalactic/enterprise/organization.py:1.19 Thu Jul 15 15:14:49 2004 +++ PanGalactic/pangalactic/enterprise/organization.py Sun Aug 8 21:35:39 2004 @@ -1,65 +1,248 @@ -# $Id: organization.py,v 1.19 2004/07/15 19:14:49 pbear Exp $ +# $Id: organization.py,v 1.20 2004/08/09 01:35:39 waterbug Exp $ """ -A business entity comprised of personnel and other resources. +An Organization is a business entity composed of personnel and +other resources. """ from pangalactic.enterprise.pgefobject import PgefObject - +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Organization(PgefObject): """ - I encapsulate all information needed by PGEF about an - organization. + An Organization is a business entity composed of personnel + and other resources. """ - # _excluded_fields are those inherited from PgefObject _default_display_order = ["id", "Name", "city", "state_or_country"] _default_display_names = {"id": "ID", "Name": "Name", "city": "City", "state_or_country": "State/Country"} _default_display_types = {} - _required = ['Creator', 'Identifier', 'Type'] _properties = PgefObject._properties.copy() - _refs = {} # Keep this empty, or things could get real UGLY! - # (Person refs Org, but Org has the usual - # "creator_oid", etc., so it could get quite circular - # in a hurry. For sanity's sake, all Orgs in PGER - # will be regarded as Immaculately Conceived, - # though we suspect the Sysadmin was involved. ;^) - _schema_ext = { - 'pgef_org_name_code' : 'str', - 'name1' : 'str', - 'name2' : 'str', - 'name3' : 'str', - 'name4' : 'str', - 'name5' : 'str', - 'country_code' : 'str', - 'street_address1' : 'str', - 'street_address2' : 'str', - 'city' : 'str', - 'state_or_country' : 'str', - 'zip_or_postal_zone' : 'str', - 'phone' : 'str', - 'association_cage' : 'str', - 'status_code' : 'str', - 'type_code' : 'str', - 'replacement_cage' : 'str', - 'sic_code1' : 'str', - 'sic_code2' : 'str', - 'sic_code3' : 'str', - 'sic_code4' : 'str' - } - _schema = PgefObject._schema.copy() - _schema.update(_schema_ext) - _std_abbrev = 'org' - pgef_class = 'Organization' + _schema = OntoClass( + id='Organization', + id_context='PanGalactic', + name='Organization', + abbrev='org', + base=PgefObject._schema, + description=""" + An Organization is a business entity composed of + personnel and other resources. + """, + properties=[ + OntoProperty( + id='org_name_code', + id_context='PanGalactic', + name='Organization Name Code', + pgef_datatype='str', + description=""" + An abbreviation for the organization's name. Maps to + mfr_name_code in Part. Corresponds to the parent + organization identifier -- i.e., association_cage -- + but is a "mnemonic" string. Therefore, it is not + unique within the organization table, since several + locations of the same organization will have the same + org_name_code. + """), + OntoProperty( + id='name1', + id_context='PanGalactic', + name='Name 1', + pgef_datatype='str', + description=""" + The first of a possible 5 segments of the + organization's name. (From the CAGE data structure.) + """), + OntoProperty( + id='name2', + id_context='PanGalactic', + name='Name 2', + pgef_datatype='str', + description=""" + The second of a possible 5 segments of the + organization's name. (From the CAGE data structure.) + """), + OntoProperty( + id='name3', + id_context='PanGalactic', + name='Name 3', + pgef_datatype='str', + description=""" + The third of a possible 5 segments of the + organization's name. (From the CAGE data structure.) + """), + OntoProperty( + id='name4', + id_context='PanGalactic', + name='Name 4', + pgef_datatype='str', + description=""" + The fourth of a possible 5 segments of the + organization's name. (From the CAGE data structure.) + """), + OntoProperty( + id='name5', + id_context='PanGalactic', + name='Name 5', + pgef_datatype='str', + description=""" + The fifth of a possible 5 segments of the + organization's name. (From the CAGE data structure.) + """), + OntoProperty( + id='country_code', + id_context='PanGalactic', + name='Country Code', + pgef_datatype='str', + default='1', + min_cardinality=1, + description=""" + Country Code: 1=U.S., 2=Foreign, 3=Canada + (From the CAGE data structure.) + """), + OntoProperty( + id='street_address1', + id_context='PanGalactic', + name='Street Address 1', + pgef_datatype='str', + description=""" + The first of a possible 2 segments of the + organization's street address. (From the CAGE data + structure.) + """), + OntoProperty( + id='street_address2', + id_context='PanGalactic', + name='Street Address 2', + pgef_datatype='str', + description=""" + The second of a possible 2 segments of the + organization's street address. (From the CAGE data + structure.) + """), + OntoProperty( + id='city', + id_context='PanGalactic', + name='City', + pgef_datatype='str', + description=""" + The organization's city. (From the CAGE data + structure.) + """), + OntoProperty( + id='state_or_country', + id_context='PanGalactic', + name='State or Country', + pgef_datatype='str', + description=""" + The organization's state (if in the U.S.) or country. + (From the CAGE data structure.) + """), + OntoProperty( + id='zip_or_postal_zone', + id_context='PanGalactic', + name='Zip or Postal Zone', + pgef_datatype='str', + description=""" + The organization's zip code (if in the U.S.) or + postal zone. (From the CAGE data structure.) + """), + OntoProperty( + id='phone', + id_context='PanGalactic', + name='Phone', + pgef_datatype='str', + description=""" + The organization's phone number. (From the CAGE data + structure.) + """), + OntoProperty( + id='association_cage', + id_context='PanGalactic', + name='Parent Organization', + pgef_datatype='str', + description=""" + The organization's parent organization's CAGE code. + (From the CAGE data structure.) + """), + OntoProperty( + id='status_code', + id_context='PanGalactic', + name='Status Code', + pgef_datatype='str', + description=""" + The status of this CAGE code. (From the CAGE data + structure.) + """), + OntoProperty( + id='type_code', + id_context='PanGalactic', + name='Type Code', + pgef_datatype='str', + description=""" + The CAGE type code. (From the CAGE data structure.) + """), + OntoProperty( + id='replacement_cage', + id_context='PanGalactic', + name='Replacement CAGE', + pgef_datatype='str', + description=""" + The CAGE code that this CAGE code replaces. (From + the CAGE data structure.) + """), + OntoProperty( + id='sic_code1', + id_context='PanGalactic', + name='SIC Code 1', + pgef_datatype='str', + description=""" + First of a possible 4 Standard Industrial + Classification (SIC) codes for this organization. + See: http://www.census.gov/epcd/www/sic.html + (From the CAGE data structure.) + """), + OntoProperty( + id='sic_code2', + id_context='PanGalactic', + name='SIC Code 2', + pgef_datatype='str', + description=""" + Second of a possible 4 Standard Industrial + Classification (SIC) codes for this organization. + See: http://www.census.gov/epcd/www/sic.html + (From the CAGE data structure.) + """), + OntoProperty( + id='sic_code3', + id_context='PanGalactic', + name='SIC Code 3', + pgef_datatype='str', + description=""" + Third of a possible 4 Standard Industrial + Classification (SIC) codes for this organization. + See: http://www.census.gov/epcd/www/sic.html + (From the CAGE data structure.) + """), + OntoProperty( + id='sic_code4', + id_context='PanGalactic', + name='SIC Code 4', + pgef_datatype='str', + description=""" + Fourth of a possible 4 Standard Industrial + Classification (SIC) codes for this organization. + See: http://www.census.gov/epcd/www/sic.html + (From the CAGE data structure.) + """) + ]) # end of _schema def __init__(self, **kw): - # PgefObject.__init__() creates the pgef_oid ... PgefObject.__init__(self, **kw) def getName(self): @@ -75,7 +258,6 @@ setName, delName, "Name") - _properties["Name"] = "str" # Some data that could be used in testing: Index: PanGalactic/pangalactic/enterprise/document.py diff -u PanGalactic/pangalactic/enterprise/document.py:1.56 PanGalactic/pangalactic/enterprise/document.py:1.57 --- PanGalactic/pangalactic/enterprise/document.py:1.56 Thu Jul 15 15:14:49 2004 +++ PanGalactic/pangalactic/enterprise/document.py Sun Aug 8 21:35:39 2004 @@ -1,100 +1,188 @@ -# $Id: document.py,v 1.56 2004/07/15 19:14:49 pbear Exp $ +# $Id: document.py,v 1.57 2004/08/09 01:35:39 waterbug Exp $ """ -The Mother of all PGEF Document types. :) +Document is the Mother of all PanGalactic Document types. :) """ -__version__ = "$Revision: 1.56 $"[11:-2] +__version__ = "$Revision: 1.57 $"[11:-2] from mx import DateTime import string from pangalactic.enterprise.versionedobject import VersionedObject - - -def FillSampleDocument(document): - document.creator_oid = 'Test Harness' +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty class Document(VersionedObject): - # TODO: document property attributes (e.g. Dublin Core - # stuff). """ - I encapsulate the most generic document attributes and - behaviors. + The Document class encapsulates the most generic document attributes + and behaviors. The purpose of the Document class is primarily to provide an - application-level interface adaptable to the many contexts in - which a document concept can be found. Its methods should - probably be defined in an interface (IDocument). - - A Document can have one or more representations (e.g., HTML, - PDF, etc.), each of which can have one or more - L{pangalactic.enterprise.pgeffile.PgefFile} objects associated - with it (e.g., a DTD, a stylesheet, an XML file, etc.). + application-level interface adaptable to the many contexts in which a + document concept can be found. Its methods should probably be defined + in an interface (IDocument). + + A Document can have one or more representations (e.g., HTML, PDF, + etc.), each of which can have one or more + L{pangalactic.enterprise.pgeffile.PgefFile} objects associated with it + (e.g., a DTD, a stylesheet, an XML file, etc.). """ - # NOTE: '_contains' has been deactivated indefinitely - # _contains = VersionedObject._contains.copy() - # _contains_ext = {'_files' : 'PgefFile'} - # _contains.update(_contains_ext) - # _contains_methods = VersionedObject._contains_methods.copy() - # _contains_methods_ext = {'_files' : 'addFile'} - # _contains_methods.update(_contains_methods_ext) - _excluded_fields = VersionedObject._excluded_fields - _fk = { - '_project' : 'project_oid' - } _default_display_names = {"Title" : "Title", - "creator_oid" : "Creator", + "creator" : "Creator", "Revision" : "Rev", "Date" : "Date", "DocType" : "Type"} - _default_display_order = ["Title", "creator_oid", "Revision", "Date", "DocType"] + _default_display_order = ["Title", + "creator", + "Revision", + "Date", + "DocType"] _default_display_types = {} - + _excluded_fields = VersionedObject._excluded_fields # These are from the Dublin Core, and are computed attributes - _properties = { - 'Title' : 'str', + _properties = {'Title' : 'str', 'title' : 'str', 'Identifier' : 'str', 'Creator' : 'str', 'Revision' : 'str', 'Description' : 'str', 'Date' : 'str', - 'DocType' : 'str' - } - _refs = VersionedObject._refs.copy() - _refs_ext = {} - _refs.update(_refs_ext) + 'DocType' : 'str'} _required = [] # for the time being, don't require anything - _schema = VersionedObject._schema.copy() - _schema_ext = { - 'doc_type_oid' : 'str', - 'structural_role' : 'str', - 'abstract' : 'str', - 'content' : 'str', - 'mime_type_oid' : 'str', - 'publish_datetime' : 'DateTime' - } - _schema.update(_schema_ext) - _searchabletext = True - _std_abbrev = 'doc' - pgef_class = 'Document' + _schema = OntoClass( + id='Document', + id_context='PanGalactic', + name='Document', + abbrev='doc', + base=VersionedObject._schema, + description=""" + The PGEF Document class is intended to support the whole + spectrum of "structured product documents", including: + + -- blob documents, represented as metadata with paths (which may + be URL's) to file(s) + -- versioned and non-versioned documents + -- master documents, templates, and document components + -- unstructured text files (including "annotations") + -- documents containing some validated fields and some + unstructured components (free text, attachments, etc.) + -- fully structured documents with semantically named components + and several presentations / representations (see discussion in + the explanation of subtype = 'iteration', below) + + NOTE: a document component is related to an associated document + "assembly" in the PGEF ontology by a "Document Component Usage" + (Dcu) relationship. This enables two things: (1) reuse of document + components in multiple documents; (2) the use of versioned + components (i.e., a document component could also have a subtype of + 'master' or 'version' and associated rules for effectivity -- which + will require modification of this schema to include effectivity ... + but we knew that. :^) + + [STEP] Dcu maps to "document as product". In STEP, a document is + represented as a product with which is associated a + product_related_product_category with name 'document'. If its + product_definition_context.name 'physical document definition', it + is a non-computerized (paper, etc.) document; if it is 'digital + document definition', it is a digitally-encoded representation. + """, + properties=[ + OntoProperty( + id='name', + id_context='PanGalactic', + name='Name', + pgef_datatype='str', + description=""" + (Overrides definition inherited from PgefObject.) + Semantic depends on the value of the structural_role + attribute. + structural_role ==> "name" maps to + --------------- -------------- + 'root' ............ title + 'component' ....... component name (for XML docs, + this may map to an element tag) + """), + OntoProperty( + id='structural_role', + id_context='PanGalactic', + name='Structural Role', + pgef_datatype='str', + default='root', + min_cardinality=1, + description=""" + Determines the semantic of the name attribute (q.v.) + and whether the doc_type_code should be populated. + Initial set of allowed values: + 'root' ......... a Document intended to be used as a + top-level parent Document, whether + with or without components; it can be + used as an attachment but not as a + component + 'component' .... a Document intended to be used as a + component of another Document + (may have internal structure itself) + """), + OntoProperty( + id='abstract', + id_context='PanGalactic', + name='Abstract', + pgef_datatype='str', + description=""" + A capsule summary of the Document's content. + """), + OntoProperty( + id='content', + id_context='PanGalactic', + name='Content', + pgef_datatype='str', + description=""" + The content of the Document in a text-based format + (preferably plain text, but may be any format with a + MIME type of "text", such as text/html, text/xml, or + text/tab-separated-values). + """), + OntoProperty( + id='content_mime_type', + id_context='PanGalactic', + name='Content Mime Type', + pgef_datatype='MediaType', + property_type='object', + description=""" + The MIME type of the value of the 'content' + attribute. (This does *not* imply that a Document + has an intrinsic MIME type! In general, each + representation of the Document will have a distinct + MIME type.) + """), + OntoProperty( + id='publish_datetime', + id_context='PanGalactic', + name='Date and Time Published', + pgef_datatype='DateTime', + description=""" + Date (and time, if relevant) the Document was + published. + """), + OntoProperty( + id='files', + id_context='PanGalactic', + name='Files', + pgef_datatype='PgefFile', + property_type='object', + min_cardinality=0, + max_cardinality=0, + description=""" + All PgefFiles associated with the Document + (representations, attachments, etc.). + """) + ]) # end of _default_schema - def __init__(self, _files = None, _reps = None, **kw): + def __init__(self, **kw): """ Initialize a Document object. - - @type _files: list - @param _files: a list of - L{pangalactic.enterprise.pgeffile.PgefFile} objects - associated with the Document - """ VersionedObject.__init__(self, **kw) - if not _files: - self._files = [] - if not _reps: - self._reps = [] for a in kw: if a in self._properties: try: @@ -102,47 +190,24 @@ except: pass # some properties might be read-only - if not self.mime_type_oid: - self.mime_type_oid = "text/plain" - def addFile(self, f): """ Add a new PgefFile to self._files. @type f: L{pangalactic.enterprise.pgeffile.PgefFile} @param f: a PgefFile associated with the Document """ - self._files.append(f) - - def addRep(self, f): - """ - Add a new PgefFile to self._reps. - @type f: L{pangalactic.enterprise.pgeffile.PgefFile} - @param f: a PgefFile associated with the Document - """ - self._reps.append(f) + self.files.append(f) def getFiles(self): """ - Get all files for the current version. - - @rtype: list - @return: the list of PgefFiles - for the current version (default), or the - specified revision. - """ - return self._files - - def getReps(self): - """ - Get all representations for the current version. + Get all PgefFiles for the current version. @rtype: list @return: the list of PgefFiles for the current version (default), or the specified revision. """ - return self._reps - + return self.files ####################################### ### property definitions begin here ### @@ -191,16 +256,16 @@ def getCreator(self): # for now, 'creator' is taken to be the id of the initial - # creator of the document. Actually, we probably want + # creator of the Document. Actually, we probably want # the "full name" of the person, so it will need to be # computed. (Need to look it up when Document is # initialized, or else assign a real Person object -- # say, _creator -- to Document and find the full name # from that.) - return self.__dict__['creator_oid'] + return self.__dict__['creator'] def setCreator(self, value): - self.__dict__['creator_oid'] = value + self.__dict__['creator'] = value Creator = property(getCreator, setCreator, deleteAttr, 'Creator') @@ -223,15 +288,15 @@ def getDescription(self): """ Get the value of the Description, which maps to the - 'long_description' attribute. + 'description' attribute. """ - return self.long_description + return self.description def setDescription(self, value): """ Set the value of the Description. """ - self.long_description = value + self.description = value Description = property(getDescription, setDescription, deleteAttr, 'Description') Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.62 PanGalactic/pangalactic/enterprise/pgefobject.py:1.63 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.62 Thu Jul 15 15:14:49 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Sun Aug 8 21:35:39 2004 @@ -1,23 +1,12 @@ -# $Id: pgefobject.py,v 1.62 2004/07/15 19:14:49 pbear Exp $ +# $Id: pgefobject.py,v 1.63 2004/08/09 01:35:39 waterbug Exp $ """ -The Mother of all PGEF Enterprise Classes. +PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.62 $ +@version: $Revision: 1.63 $ """ -# TODO: -# 1. The following class method names need to be changed to -# adopt the Pan Galactic naming standard -# -# - IsEqual -> isEqual -# - is only used in some old code that might be obsolete -# (e.g., itemeditframe, documenttreeframe, and -# some tests ...) -- should we jettison this? -# Nope. -# - IsEmpty -> isEmpty - -__version__ = "$Revision: 1.62 $"[11:-2] +__version__ = "$Revision: 1.63 $"[11:-2] import types import string @@ -25,109 +14,87 @@ import copy from mx import DateTime -from twisted.spread import pb +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty from pangalactic.utils import oid from pangalactic.utils import datetimes from pangalactic.utils import pgefexceptions -from pangalactic.utils.utils import compareSequence1 +from pangalactic.utils import utils -class PgefObject(object, pb.Cacheable, pb.RemoteCache): +class PgefObject(object): """ - This is the base class for all of the Pgef data classes. - - @type _attrs: list - @cvar _attrs: the names of all persistent attributes, in - their default order. + PgefObject is the base class for all of the PanGalactic + Enterprise classes (generic domain objects). @type _default_display_order: list @cvar _default_display_order: the names of all "public" - attributes in the order in which they are - to be displayed when presented in a user - interface. - - C{[ attr_name1, attr_name2, ... ]} + attributes in the order in which they are to be displayed + when presented in a user interface. + + - C{[ attr_name1, attr_name2, ... ]} @type _default_display_names: dictionary @cvar _default_display_names: defines the display names - (for column headings, field names, - etc.) to be used for attributes when - they are presented in a user interface. - - C{{ attr_name : display_name, ... }} + (for column headings, field names, etc.) to be used for + attributes when they are presented in a user interface. + + - C{{ attr_name : display_name, ... }} @type _default_display_types: dictionary @cvar _default_display_types: defines the display types - (for columns, fields, etc.) to be used for - attributes when presented in a user - interface. - - C{{ attr_name : type, ... }} + (for columns, fields, etc.) to be used for attributes + when presented in a user interface. + + - C{{ attr_name : pgef_datatype, ... }} @type _excluded_fields_ext: list @cvar _excluded_fields_ext: attributes introduced in the - subclass that are excluded from the IsEqual - and IsEmpty methods. The _excluded_fields - attribute of the subclass is formed by - combining this with the _excluded_fields - attribute(s) of its superclass(es). + subclass that are excluded from the isEqual and isEmpty + methods. The _excluded_fields attribute of the subclass + is formed by combining this with the _excluded_fields + attribute(s) of its superclass(es). @type _excluded_fields: list - @cvar _excluded_fields: attributes excluded from the IsEqual - and IsEmpty methods. These are basically any - attributes that receive non-empty default - values when an instance is initialized. - - @type _fk: dictionary - @cvar _fk: each attribute in _refs mapped to its foreign key + @cvar _excluded_fields: attributes excluded from the isEqual + and isEmpty methods. These are basically any attributes + that receive non-empty default values when an instance is + initialized. @type _properties: dictionary @cvar _properties: the names and types of all attributes - that are computed as Python properties and - their types. (_properties are used to - support mapping from _schema attributes to - attributes defined in some other ontology, - such as the Dublin Core for Document. - - C{{ attr_name : type, ... }} - - @type _schema: dictionary - @cvar _schema: defines the persistable attributes of - PgefObject and their type names. (_schema - defines the "internal view" of the object, - whereas _properties define the "external - view".) - - C{{ attr_name : type, ... }} - - @type _refs: dictionary - @cvar _refs: instance attributes that are PgefObjects, - mapped to their class names: - - C{_refs = { attr_name : classname, ... }} + that are computed as Python properties and their types. + (_properties are used to support mapping from _schema + attributes to attributes defined in some other ontology, + e.g. the Dublin Core attributes for Document. + + - C{{ attr_name : pgef_datatype, ... }} @type _required: list @cvar _required: attributes that must be populated with - non-empty values + non-empty values - @type _std_abbrev: string - @cvar _std_abbrev: the standard abbreviation for this - classname (used in forming the names of - relationship tables and foreign key - constraint names) + @type _schema: OntoClass + @cvar _schema: defines the persistable attributes of a + domain object, whose Python class will be an instance of + L{pangalactic.enterprise.pgefobject.PgefObject} or one of + its subtypes. (Note that some of the external attributes + may be derived from the _schema attributes, in which case + they are defined as Python descriptors and listed in the + _properties attribute of the class.) """ - _default_display_order = ["pgef_class", - "id", "name", - "short_description", + _default_display_order = ["id", + "name", + "description", "create_datetime", - "creator_oid", - "pgef_oid"] - - _default_display_names = {"pgef_oid" : "Oid", - "id" : "ID", - "name" : "Name", - "short_description" : "Description", - "pgef_class" : "Type", - "create_datetime" : "Created", - "creator_oid" : "Creator"} - + "creator"] + _default_display_names = {"id" : "ID", + "name" : "Name", + "description" : "Description", + "create_datetime" : "Created", + "creator" : "Creator"} _default_display_types = {} - # pgef_oid, create_datetime, and mod_datetime are excluded # fields because they receive non-null default values at # initialization time. @@ -136,100 +103,291 @@ 'create_datetime', 'mod_datetime' ] - _fk = {} _properties = {} _required = [] - _refs = {} - _schema = { - 'pgef_oid' : 'str', - 'pgef_class' : 'str', - 'onto_class' : 'str', - 'id' : 'str', - 'id_context' : 'str', - 'pgef_security_mask' : 'int', - 'name' : 'str', - 'short_description' : 'str', - 'long_description' : 'str', - 'pger_owner_oid' : 'str', - 'pger_creator_oid' : 'str', - 'pger_create_datetime' : 'DateTime', - 'pger_modifier_oid' : 'str', - 'pger_mod_datetime' : 'DateTime', - 'owner_oid' : 'str', - 'creator_oid' : 'str', - 'create_datetime' : 'DateTime', - 'modifier_oid' : 'str', - 'mod_datetime' : 'DateTime' - } - _std_abbrev = 'po' - pgef_class = 'PgefObject' + _schema = OntoClass( + id='PgefObject', + id_context='PanGalactic', + name='PGEF Object', + abbrev='po', + description=""" + All entities that are managed in the Pan Galactic + Engineering Repository (PGER) are subtypes of PgefObject. + + All PgefObjects are assigned a unique pgef_oid. The + pgef_oid is intended to be unique within the entire + Galaxy -- er, scope of a Pan Galactic Engineering + Framework (PGEF) application, as opposed to being unique + only within PGER. It is created at the time of creation + of the PgefObject in the application and is applicable to + local PgefObjects as well as those stored in PGER. + + Every PgefObject is manageable within the context of PGER + -- it has time-date stamps for its instantiation and last + modification in PGER, required references to its creator + in PGER (pger_creator) and last modifier in PGER + (pger_modifier), and an optional reference to its PGER + owner (pger_owner), if different from its PGER creator. + + The vast majority of objects stored in PGER will be + initially instantiated, and probably also managed, + outside of PGER by some engineering software tool, and + therefore may have creation and modification datetimes + (create_datetime and mod_datetime) different from their + creation and modification time-date stamps in PGER + (pger_create_datetime and pger_mod_datetime), so unless + an entity is *only* created in PGER, the external creator + ("creator" attribute), modifier ("modifier" attribute) + and owner ("owner" attribute) and the create_datetime and + mod_datetime (if known) should be populated. + """, + properties=[ + OntoProperty( + id='pgef_oid', + id_context='PanGalactic', + name='OID', + pgef_datatype='str', + description=""" + [pgef:pgef_oid] 'pgef_oid' is an object identifier that is + intended to be unique across all PGEF application instances in + all PGEF applications, whether they are in communication or + not. It is usually constructed as the concatenation of the + object creator's id, which is typically their email address + (hence a URI for a Person), with the timestamp of the object's + creation in Universal Time. However, in cases in which an + object has been assigned a URI, it's preferable to use the URI + as the pgef_oid. In the future, some form of canonical + URI-generation might replace the current default pgef_oid + construction. + """), + OntoProperty( + id='id', + id_context='PanGalactic', + name='ID', + pgef_datatype='str', + description=""" + [step:id] [rdf:ID] Id is an identifier that is unique within + some specified context (the id_context). There are no + constraints on the population of id/id_context; however, in a + canonical data definition scheme, id should be a local name and + id_context should be a namespace, and the combination of the + two should form a URI. + """), + OntoProperty( + id='id_context', + id_context='PanGalactic', + name='ID Context', + pgef_datatype='str', + default='NOCONTEXT', + description=""" + [xml:base] 'id_context' is the context, base URL, or namespace + within which the id is unique. + """), + OntoProperty( + id='security_mask', + id_context='PanGalactic', + name='Security Mask', + pgef_datatype='int', + default='0', + description=""" + [pgef:security_mask] Support for instance-level customizable + access control. Accessibility of each entity instance (row) + will be governed by testing its security_mask against the + security_mask assigned to the user. Details TBD. + """), + OntoProperty( + id='name', + id_context='PanGalactic', + name='Name', + pgef_datatype='str', + description=""" + [rdfs:label] A presentation name or human-readable name for the + object -- usually the name by which the object is known to an + end-user, but may be used for any type of appellation or + identification, including aliases and local nomenclatures. Its + meaning is application context-dependent. This 'name' concept + is analogous to a person's given name. + """), + OntoProperty( + id='description', + id_context='PanGalactic', + name='Description', + pgef_datatype='str', + description=""" + [rdf:Description] A narrative about the characteristics and + identifying features of the object. + """), + OntoProperty( + id='comment', + id_context='PanGalactic', + name='Comment', + pgef_datatype='str', + description=""" + [rdfs:comment] Provides information about the object that may + be incidental, temporal, or contextual, and is usually in + addition to the information in 'description'. The meaning of + 'comment' is determined by the application context. + """), + OntoProperty( + id='pger_owner', + id_context='PanGalactic', + name='PGER Owner', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:pger_owner] The user who owns the object's record in + PGER. + (1) pger_owner and pger_creator are both provided in case the + owner and creator of the PgefObject are different. The default + is for them to be the same. + (2) The default is pger_owner == pger_creator. (This will be + enforced by PGER.) + (3) The owner always has the privilege of modifying the + PgefObject (or deleting it, if deletion is allowed for that + entity type). + """), + OntoProperty( + id='pger_creator', + id_context='PanGalactic', + name='PGER Creator', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:pger_creator] The user who first added the object's + record to PGER. + """), + OntoProperty( + id='pger_create_datetime', + id_context='PanGalactic', + name='PGER Create Date-Time', + pgef_datatype='DateTime', + description=""" + [pgef:pger_create_datetime] Date-time of addition of the + object's record to PGER. + """), + OntoProperty( + id='pger_modifier', + id_context='PanGalactic', + name='PGER Modifier', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:pger_modifier] The user who last modified the object's + record in PGER. + """), + OntoProperty( + id='pger_mod_datetime', + id_context='PanGalactic', + name='PGER Last Mod Date-Time', + pgef_datatype='DateTime', + description=""" + [pgef:pger_mod_datetime] Date-time of last modification of the + object's record in PGER. + """), + OntoProperty( + id='owner', + id_context='PanGalactic', + name='PGER Owner', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:owner] The person who owns the object. + """), + OntoProperty( + id='owner_org', + id_context='PanGalactic', + name='Owner Organization', + pgef_datatype='Organization', + property_type='object', + description=""" + [pgef:owner_org] The organization that owns the object. + """), + OntoProperty( + id='creator', + id_context='PanGalactic', + name='Creator', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:creator] The person who created the object. + """), + OntoProperty( + id='create_datetime', + id_context='PanGalactic', + name='Create Date-Time', + pgef_datatype='DateTime', + description=""" + [pgef:create_datetime] Date-time of creation of the object. + """), + OntoProperty( + id='modifier', + id_context='PanGalactic', + name='Modifier', + pgef_datatype='Person', + property_type='object', + description=""" + [pgef:modifier] The person who last modified the object. + """), + OntoProperty( + id='mod_datetime', + id_context='PanGalactic', + name='Mod Date-Time', + pgef_datatype='DateTime', + description=""" + [pgef:mod_datetime] Date-time of last modification of the + object's record in PGER. + """), + OntoProperty( + id='reps', + id_context='PanGalactic', + name='Representations', + display_name='Files', + pgef_datatype='PgefRepresentation', + property_type='object', + min_cardinality=0, + max_cardinality=0, + description=""" + [pgef:representations] PgefRepresentation(s) either created + from this object (generable=True) or from which this object can + be created (composable=True). The representation from which + the object was originally imported (if any) will have its + 'is_origin' attribute set to True. PgefRepresentations include + both "presentations", such as PDF or HTML for a document, and + more general representations such as (for a model) different + serializations (STEP Part 21, UML, OWL, etc.), proprietary file + formats, etc. + """) + ]) # end of _schema def __init__(self, **kw): """ Initialize a PgefObject. - - TO DO: - - bring in attribute definitions from - create_pgerdb_tables.sql and format them in epydoc - style. """ + # TODO: bring in attribute definitions from + # create_pgerdb_tables.sql and format them in epydoc + # style. self.state = kw.get('state', '') - # use schema and fk if they are passed in; otherwise, use the - # class's _schema and _fk ... - # self._schema = kw.get('schema', self._schema) - # self._fk = kw.get('fk', self._fk) - # loop over _schema; try to set values from kw args or - # defaults, ignoring unsettable attributes ... + if kw.get('_schema', None): + self._schema = kw['_schema'] + # Property-ize _schema attributes and automate + # type-checking ... for a in self._schema: - if self._schema[a] == 'str' and a != 'pgef_class': - try: - setattr(self, a, kw.get(a, '')) - except: - pass - elif self._schema[a] == 'DateTime': - try: - setattr(self, a, kw.get(a, None)) - except: - pass - elif self._schema[a] == 'int': - try: - setattr(self, a, kw.get(a, 0)) - except: - pass - elif self._schema[a] == 'bool': - try: - setattr(self, a, kw.get(a, False)) - except: - pass - self.pgef_class = self.__class__.__name__ - # loop over _refs; set values from kw args or - # defaults ... - for a in self._refs: - if (kw.get(a, None).__class__.__name__ == self._refs[a]): - setattr(self, a, kw[a]) - else: - setattr(self, a, None) - ###### DEBUGGING ######## - # print '%s passed in is not %s ...' % (a, self._refs[a]) - # print 'setting %s to None.' % a + setattr(self, a, kw.get(a, self._schema[a].default)) # create an oid if one isn't passed in ... if not kw.get('pgef_oid', None): - self.pgef_oid = oid.generate((kw.get('creator_oid', '') - or kw.get('owner_oid', '') - or kw.get('modifier_oid', ''))) - # if no oid is passed in, assume we are a new instance, - # and record our creation/mod datetime ... - if not kw.get('pgef_oid'): + self.pgef_oid = oid.generate(kw.get('creator', '') + or kw.get('owner', '') + or kw.get('modifier', '')) + # also infer that we are a new instance and record + # our [create,mod]_datetime self.create_datetime = DateTime.now() self.mod_datetime = DateTime.now() - self.onto_class = self.__class__.__name__ - self._display_map = [] self._display_order = copy.copy(self._default_display_order) + # TODO: generate these from the OntoProperty.display_name's self._display_names = self._default_display_names.copy() self._display_types = self._default_display_types.copy() - def getDisplayMap(self, dorder = None, dnames = None, dtypes = None): """ Generate a grid map from the combination of a @@ -237,37 +395,23 @@ display_types mapping. """ #print "pgefobject.getdisplaymap" - - # start with the attributes attr_names = self.__dict__.keys() - - # add the schema - for a in self._schema: - if a not in attr_names: - attr_names.append(a) - - # what about properties? - for prop, prop_type in self._properties.items(): - attr_names.append(prop) - - attr_names.sort() - - labels = [(attr_name, attr_name.replace("_", " ").title().strip()) for attr_name in attr_names] + labels = [(attr_name, attr_name.replace("_", " ").title().strip()) + for attr_name in attr_names] if not self._default_display_names: self._default_display_names = dict(labels) if not self._default_display_order: - labels.sort(compareSequence1) + labels.sort(utils.compareSequence1) self._default_display_order = [label[0] for label in labels] if not self._default_display_types: attr_types = [(attr_name, "string") for attr_name in attr_names] self._default_display_types = dict(attr_types) for attr_name, attr_type in attr_types: - if hasattr(self, attr_name): - obj = getattr(self, attr_name) #self.__dict__[attr_name] - if isinstance(obj, PgefObject): - self._default_display_types[attr_name] = obj.pgef_class + obj = self.__dict__[attr_name] + if isinstance(obj, PgefObject): + self._default_display_types[attr_name] = obj.name if not dnames: dnames = self._default_display_names @@ -309,8 +453,7 @@ self._display_names = self._default_display_names.copy() self._display_types = self._default_display_types.copy() - - def set_string_date(self): + def set_string_date(self, value): raise TypeError, 'Attribute cannot be set' def delete_date(self): @@ -322,23 +465,10 @@ else: return '' - _create_date = property(get_create_date, - set_string_date, - delete_date, - '_create_date') - _properties["_create_date"] = "str" - - def get_create_datetime(self): - if self.create_datetime: - return datetimes.getDisplayDateTime(self.create_datetime) - else: - return '' - - _create_datetime = property(get_create_datetime, - set_string_date, - delete_date, - '_create_date') - _properties["_create_datetime"] = "str" + create_date = property(get_create_date, + set_string_date, + delete_date, + 'create_date') def get_mod_date(self): if self.mod_datetime: @@ -346,24 +476,10 @@ else: return '' - _mod_date = property(get_mod_date, - set_string_date, - delete_date, - '_mod_date') - _properties["_mod_date"] = "str" - - def get_mod_datetime(self): - if self.mod_datetime: - return datetimes.getDisplayDateTime(self.mod_datetime) - else: - return '' - - _mod_datetime = property(get_mod_datetime, - set_string_date, - delete_date, - '_mod_date') - _properties["_mod_datetime"] = "str" - + mod_date = property(get_mod_date, + set_string_date, + delete_date, + '_mod_date') def __len__(self): """ @@ -388,8 +504,8 @@ Output a human-readable string presentation for a PgefObject. """ - outstring = "\n" - outstring += self.__class__.__name__ + outstring = "\n" + self.__class__.__name__ + outstring += "\n OntoClass: %s" % self._schema.name attribs = self.__dict__.keys() for a in self._schema: if a not in attribs: @@ -407,20 +523,21 @@ outstring += "\n" return outstring - def InitObject(self, currentproject, userid): + def initObject(self, currentproject, userid): """ Populate certain attributes of a PgefObject that should be populated at creation time. """ - self._project = currentproject + self.project = currentproject # project should be pushed down into specific # subtypes; doesn't make sense for all objects - self.owner_oid = userid - self.creator_oid = userid - self.modifier_oid = userid - self.mod_datetime = self.create_datetime + self.owner = userid + self.creator = userid + self.modifier = userid + self.create_datetime = DateTime.now() + self.mod_datetime = DateTime.now() - def UpdateObject(self, userid): + def updateObject(self, userid): """ Set modifier to userid and mod_datetime to current time. @@ -428,9 +545,9 @@ @param userid: userid of the user doing the mod. """ self.modifier = userid - self.mod_datetime = time.strftime("%m/%d/%Y %H:%M:%S") + self.mod_datetime = DateTime.now() - def IsEqual(self, other): + def isEqual(self, other): """ Return True if the two objects are of the same class and the stringized values of their _schema attributes (the @@ -464,13 +581,11 @@ @param datadict: a dictionary of instance attributes of the class and their values """ - self.__dict__.update(datadict) - -# for a in datadict: -# if a in self._schema: -# self.__dict__[a] = datadict[a] + for a in datadict: + if a in self._schema: + setattr(self, a, datadict[a]) - def IsEmpty(self): + def isEmpty(self): """ Return False if the instance has non-default data in its "schema" attributes (the instance attributes that @@ -482,8 +597,6 @@ for a in self._schema: if a in self._excluded_fields: pass - elif a == 'pgef_class': - pass value = self.__dict__[a] if (isinstance(value, types.StringType) and value <> "0" @@ -531,31 +644,6 @@ print "msg", msg raise pgefexceptions.RequiredDataError, msg return True - - def popTestData(self): - """ - Populate an instance's unpopulated attributes with some - test data. (This method may be extended in subclasses.) - """ - # this id is not very useful for testing, but a test - # script will have to set it to something anyway ... - self.id = self.id or "idthis" - self.id_context = self.id_context or "TEST" - # make sure foreign keys to "person" table are valid for - # testing purposes ... - dtstamp = DateTime.now() - for a in ['create_datetime', - 'mod_datetime']: - if not getattr(self, a): - setattr(self, a, dtstamp) - for a in ['owner_oid', - 'creator_oid', - 'modifier_oid', - 'pger_owner_oid', - 'pger_creator_oid', - 'pger_modifier_oid']: - if not getattr(self, a): - setattr(self, a, 'test') def update(self, **kw): """ From waterbug at ned.gsfc.nasa.gov Sun Aug 8 21:37:28 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 21:37:29 2004 Subject: [Pangalactic-commits] A few more new enterprise classes. Message-ID: <200408090137.i791bSCs017346@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/enterprise/mime.py None 1.1 PanGalactic/pangalactic/enterprise/personrole.py None 1.1 PanGalactic/pangalactic/enterprise/pgefrepresentation.py None 1.1 Log message: A few more new enterprise classes. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 21:41:26 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 21:41:28 2004 Subject: [Pangalactic-commits] No conflicts in utils ... yay! :) Message-ID: <200408090141.i791fQ9B017407@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/datamanager.py 1.128 1.129 PanGalactic/pangalactic/utils/dbbrowser.py 1.25 1.26 PanGalactic/pangalactic/utils/localdb.py 1.102 1.103 PanGalactic/pangalactic/utils/pgefexceptions.py 1.3 1.4 PanGalactic/pangalactic/utils/registry.py 1.23 1.24 PanGalactic/pangalactic/utils/securitymanager.py 1.8 1.9 PanGalactic/pangalactic/utils/sql.py 1.18 1.19 PanGalactic/pangalactic/utils/userinfo.py 1.4 1.5 PanGalactic/pangalactic/utils/utils.py 1.6 1.7 PanGalactic/pangalactic/utils/xmlrpcinterface.py 1.65 1.66 Log message: No conflicts in utils ... yay! :) Index: PanGalactic/pangalactic/utils/securitymanager.py diff -u PanGalactic/pangalactic/utils/securitymanager.py:1.8 PanGalactic/pangalactic/utils/securitymanager.py:1.9 --- PanGalactic/pangalactic/utils/securitymanager.py:1.8 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/securitymanager.py Sun Aug 8 21:41:24 2004 @@ -1,5 +1,5 @@ import pangalactic.enterprise.person -import pangalactic.enterprise.role +import pangalactic.enterprise.pgefrole class Roles: @@ -123,10 +123,10 @@ for role in roles: if temp.has_key(role.RoleCode): templist = temp[role.RoleCode] - templist.append(role.project_oid) + templist.append(role.project) else: templist = [] - templist.append(role.project_oid) + templist.append(role.project) temp[role.RoleCode] = templist self._User.comp_role_bit_mask = temp self._Roles = temp @@ -182,7 +182,7 @@ if object: if 'P' in role: if action == objectstatus.DELETE or action == objectstatus.MODIFY: - if object.owner_oid == self._dm.user.id: + if object.owner == self._dm.user.id: return True elif action == objectstatus.ADD: return True Index: PanGalactic/pangalactic/utils/xmlrpcinterface.py diff -u PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.65 PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.66 --- PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.65 Mon Jul 12 15:33:11 2004 +++ PanGalactic/pangalactic/utils/xmlrpcinterface.py Sun Aug 8 21:41:24 2004 @@ -3,17 +3,17 @@ """ PanGalactic Client XML-RPC Interfaces -@version: $Revision: 1.65 $ +@version: $Revision: 1.66 $ """ -__version__ = "$Revision: 1.65 $"[11:-2] +__version__ = "$Revision: 1.66 $"[11:-2] import xmlrpclib import types import string import httplib from base64 import encodestring -from pangalactic.utils.factory import PgefFactory +from pangalactic.meta.factory import PanGalacticFactory class BasicAuthTransport(xmlrpclib.Transport): @@ -119,13 +119,13 @@ secure=1, domains='PanGalactic'): # proxyhost=None, proxyport=None ... # (we'll worry about proxies later :) - self._factory = PgefFactory(domains=domains) + self._factory = PanGalacticFactory(domains=domains) if secure: # not tested, according to xmlrpclib docs conns = 'https://' else: conns = 'http://' - conns = conns + host + ':' + port + conns = conns + host + ':' + str(port) #print 'connection string is:', conns if username and password: self.username = username @@ -157,7 +157,11 @@ def openPodBayDoor(self): return self._RPC.openPodBayDoor() - def changePassword(self, password, username = ""): + def changePassword(self, password, username=''): + if not username: + username = self.username + elif username != self.username and username != 'admin': + raise ValueError, "Only admin can change others' passwords." return self._RPC.changePassword(password, username) def addObjects(self, object_list, objlist = None): @@ -286,7 +290,7 @@ if data: #print " #data found", len(data) #for d in data: - # print d["id"], d["short_description"], d["onto_class"] + # print d["id"], d["description"], d["onto_class"] objlist, localobjs = self._factory.rememberAll(data, localobjs) #print "len objlist", len(objlist) #print "len localobjs", len(localobjs) @@ -325,7 +329,7 @@ if data: #print " #data found", len(data) #for d in data: - # print d["id"], d["short_description"], d["onto_class"] + # print d["id"], d["description"], d["onto_class"] objlist, localobjs = self._factory.rememberAll(data, localobjs) for obj in objlist: Index: PanGalactic/pangalactic/utils/utils.py diff -u PanGalactic/pangalactic/utils/utils.py:1.6 PanGalactic/pangalactic/utils/utils.py:1.7 --- PanGalactic/pangalactic/utils/utils.py:1.6 Wed Apr 14 16:48:27 2004 +++ PanGalactic/pangalactic/utils/utils.py Sun Aug 8 21:41:24 2004 @@ -2,7 +2,7 @@ PGEF utility programs """ -# $Id: utils.py,v 1.6 2004/04/14 20:48:27 pbear Exp $ +# $Id: utils.py,v 1.7 2004/08/09 01:41:24 waterbug Exp $ from __future__ import generators import sys, string @@ -173,4 +173,63 @@ if x not in u: u.append(x) return u + +def getDefault(prop): + """ + Get the default value of an OntoProperty (or a dictionary posing as an + OntoProperty -- i.e., in the class definitions of OntoProperty, + OntoClass, and Ontology). NOTE: this is needed because the + OntoProperty default values must be stored 'encoded' in one particular + datatype (strings are used), so they will have to be cast to the + correct datatype. + """ + if type(prop) is dict: + if prop['pgef_datatype'] == 'str': + return prop.get('default', '') + elif prop['pgef_datatype'] == 'int': + if prop.get('default', None): + return int(prop['default']) + else: + return 0 + elif prop['pgef_datatype'] == 'bool': + return bool(prop.get('default', '')) + elif prop['pgef_datatype'] == 'DateTime': + return None + elif prop.get('property_type', 'datatype') == 'object': + if prop.get('max_cardinality', 1) == 1: + return None + else: + return [] + else: + raise ValueError, 'Unknown pgef_datatype' + elif type(prop).__name__ is 'OntoProperty': + if prop.pgef_datatype == 'str': + return prop.__dict__.get('default', '') + elif prop.pgef_datatype == 'int': + if prop.__dict__.get('default', None): + return int(prop.__dict__['default']) + else: + return 0 + elif prop.pgef_datatype == 'bool': + if prop.__dict__.get('default', None): + if prop.__dict__['default'] in ['False', 'false', '0']: + return False + elif prop.__dict__['default'] in ['True', 'true', '1']: + return True + else: + raise ValueError, 'Unknown boolean default type' + else: + return False + elif prop.pgef_datatype == 'DateTime': + return None + elif prop.__dict__.get('property_type', 'datatype') == 'object': + if prop.__dict__.get('max_cardinality', 1) == 1: + return None + else: + return [] + else: + raise ValueError, 'Unknown OntoProperty.pgef_datatype' + else: + e = 'I take either an OntoProperty instance or a dictionary' + raise ValueError, e Index: PanGalactic/pangalactic/utils/registry.py diff -u PanGalactic/pangalactic/utils/registry.py:1.23 PanGalactic/pangalactic/utils/registry.py:1.24 --- PanGalactic/pangalactic/utils/registry.py:1.23 Sat May 22 04:23:40 2004 +++ PanGalactic/pangalactic/utils/registry.py Sun Aug 8 21:41:24 2004 @@ -1,81 +1,82 @@ -# $Id: registry.py,v 1.23 2004/05/22 08:23:40 waterbug Exp $ +# $Id: registry.py,v 1.24 2004/08/09 01:41:24 waterbug Exp $ """ Pan Galactic Engineering Framework Registry -@version: $Revision: 1.23 $ +@version: $Revision: 1.24 $ -I maintain a set of dictionaries used by the PgefFactory to -build objects from serialized data. - -Eventually, the registry should find PGEF application -ontologies by some process of "ontology discovery" that should -accomodate a number of different methods such as DNS, RDF, OWL, -XMI, etc. .... For now, it is hard-coded; the next step -should be to use configuration parameters if they are set; then -"distributed ontology discovery". - -The registry and the factory assume that some conventions -will be followed: - - 1. For PGEF enterprise objects (subclasses of PgefObject - in pangalactic.enterprise), the module name must be the - object name in lower-case. - - 2. Any PgefObject that contains references to other - PgefObjects (i.e., has attributes that are other - PgefObjects) must have a _refs attribute that - is a dictionary of the form { attrname : classname } - where attrname is the attribute name and classname is - the name of the pger_class that it references. (Any - subtype of PgefObject will inherit an empty _refs - attribute.) +The PanGalacticRegistry maintains information about the +pangalactic.enterprise classes and custom OntoClasses that is +used by the PanGalacticFactory to marshall and unmarshall domain +objects in a PanGalactic application. + +The registry and the factory assume that the following convention +will be followed: for PanGalactic Enterprise classes (subclasses +of UberObject in pangalactic.enterprise), the module name must be +the class name in lower-case. """ -__version__ = "$Revision: 1.23 $"[11:-2] +__version__ = "$Revision: 1.24 $"[11:-2] import imp import re import string import sys from sets import Set +from pprint import pprint +from mx import DateTime -class PgefRegistry: +class PanGalacticRegistry: """ - A registry for PanGalactic application domain classes. + A registry for the PanGalactic Enterprise classes and domain + object (application ontology) OntoClasses. - @ivar pgef_classes: - A mapping of PGEF enterprise class names to their class - objects - @type pgef_classes: dict + @ivar uberclasses: + A mapping of PanGalactic Enterprise class names to their + class objects + @type uberclasses: dict + + @ivar refs: + A dictionary that maps each PanGalactic Enterprise class + name to a dictionary that maps each of its attributes + that references another PanGalactic Enterprise class to + the name of the class it references. + @type refs: dict of dicts @ivar deps_order: - A list of all class names in pgef_classes in the - order of their dependencies, used by the - rememberAll() method of - L{pangalactic.utils.factory.PgefFactory} + A list of all class names in uberclasses in the order of + their dependencies. This is used by the rememberAll() + method of L{pangalactic.utils.factory.PanGalacticFactory} to determine the order in which a collection of serialized objects will be deserialized. @type deps_order: list """ def __init__(self, domains='PanGalactic'): - # initialize pgef_classes - self.pgef_classes = {} + # initialize uberclasses + self.uberclasses = {} + self.refs = {} domains = domains.split(',') if 'PanGalactic' not in domains: domains.append('PanGalactic') for domain in domains: - try: - domaindict = self.getDomainClasses(domain) - self.pgef_classes.update(domaindict) - except: - print """Couldn't find domain:""", domain + domaindict = self.getDomainClasses(domain) + self.uberclasses.update(domaindict) + print 'uberclasses are:' + pprint(self.uberclasses) + # build self.refns + for cn in self.uberclasses: + print 'Building refs for', cn + for a in self.uberclasses[cn]._schema: + print 'Looking at attribute', a + # TODO: handle attributes that are aggregates + if self.uberclasses[cn]._schema[a] in self.uberclasses: + self.refs[cn][a] = self.uberclasses[cn]._schema[a] # build self.deps_order # (for now, this only includes true classes) # TODO: implement handling for inheritance and dependencies # among Classes. self.deps_order = [] - todo = self.pgef_classes.copy() + todo = self.uberclasses.copy() todocns = todo.keys()[:] for cn in todocns: if not todo[cn]._refs: @@ -146,4 +147,28 @@ for name in mod.Classes: classdict[name] = self.getClass(name, pkg) return classdict + + def popTestData(self, uberobj): + """ + Populate a UberObject instance's unpopulated attributes + with some test data. + """ + # this id is not very useful for testing, but a test + # script will have to set it to something anyway ... + uberobj.id = uberobj.id or "idthis" + uberobj.id_context = uberobj.id_context or "TEST" + dtstamp = DateTime.now() + for a in ['create_datetime', + 'mod_datetime']: + if not getattr(uberobj, a): + setattr(uberobj, a, dtstamp) + for a in ['owner', + 'creator', + 'modifier', + 'pger_owner', + 'pger_creator', + 'pger_modifier']: + if not getattr(uberobj, a): + setattr(uberobj, a, + self.uberclasses['Person'](sychroid='test')) Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.128 PanGalactic/pangalactic/utils/datamanager.py:1.129 --- PanGalactic/pangalactic/utils/datamanager.py:1.128 Thu Jul 15 15:14:50 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Sun Aug 8 21:41:24 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/utils/datamanager.py,v $ -__version__ = "$Revision: 1.128 $"[11:-2] +__version__ = "$Revision: 1.129 $"[11:-2] import time @@ -22,17 +22,16 @@ import pangalactic.utils.objectstatus as objectstatus -import pangalactic.enterprise.dcu -import pangalactic.enterprise.ontoclass -import pangalactic.enterprise.ontoproperty +import pangalactic.meta.ontoclass +import pangalactic.meta.ontoproperty -from pangalactic.enterprise.docptrel import DocPtRel -import pangalactic.enterprise.role as role +from pangalactic.enterprise.acu import Acu +from pangalactic.enterprise.dcu import Dcu +from pangalactic.enterprise.pgefrole import PgefRole from pangalactic.enterprise.person import Person from pangalactic.enterprise.project import Project from pangalactic.enterprise.document import Document from pangalactic.enterprise.partslist import PartsList -from pangalactic.enterprise.acu import Acu from pangalactic.enterprise.pgeffile import PgefFile import pangalactic.enterprise.part as part @@ -41,7 +40,6 @@ import pangalactic.enterprise.workflow.wffactory as wffactory import pangalactic.enterprise.workflow.wfentity import pangalactic.enterprise.workflow.wfprocessinstance -import pangalactic.enterprise.workflow.wfprocesstemplate import pangalactic.enterprise.workflow.wfactivity import pangalactic.enterprise.workflow.wfeventaudit import pangalactic.enterprise.workflow.wftransition @@ -52,7 +50,7 @@ import pangalactic.utils.localdb as localdb -from nars.enterprise.pgefadvisory import PgefAdvisory +# from nars.enterprise.pgefadvisory import PgefAdvisory RSN_CLASSES = ["GidepAgencyActionNotice", "GidepProductChangeNotice", @@ -146,7 +144,7 @@ print "datamanager.getConfigAccess.GOD" return localdb.god - if self.user.god_flag: + if self.user.god: return localdb.god elif self.user.id == "admin": return localdb.admin @@ -195,35 +193,35 @@ if classname == "Part": obj = part.Part(id = "NEW", id_context = self.CurrentProject.id_context, - project_oid = self.CurrentProject.id, + project = self.CurrentProject.id, _project = self.CurrentProject) - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) elif classname == "Model": obj = model.Model(id = "NEW", id_context = self.CurrentProject.id_context, - project_oid = self.CurrentProject.id, + project = self.CurrentProject.id, _project = self.CurrentProject) - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) elif classname == "Document": obj = Document(id = "NEW", id_context = self.CurrentProject.id_context, - project_oid = self.CurrentProject.id, + project = self.CurrentProject.id, _project = self.CurrentProject) - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) obj._local_file_name = None elif classname == "PartsList": obj = PartsList(id = "NEW", id_context = self.CurrentProject.id_context, - project_oid = self.CurrentProject.id, + project = self.CurrentProject.id, _project = self.CurrentProject) - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) obj._local_file_name = None elif classname == "DocPtRel": obj = DocPtRel(id = "NEW", id_context = self.CurrentProject.id_context, - project_oid = self.CurrentProject.id, + project = self.CurrentProject.id, _project = self.CurrentProject) - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) elif classname == "PgefFile": print "PgefFile should not be initialized here. Use newPgefFile." return obj @@ -238,22 +236,22 @@ classname in localdb.NARS_CLASSES): obj = PgefFile(_doc = parentobj, name = dlabel, - parent_oid = parentobj.pgef_oid, - mime_type_oid = mime_type, + parent = parentobj.pgef_oid, + mime_type = mime_type, sequence = dsequence, role = drole, user_file_name = os.path.basename(filename)) elif classname == "Model": obj = PgefFile(_model = parentobj, name = dlabel, - parent_oid = parentobj.pgef_oid, - mime_type_oid = mime_type, + parent = parentobj.pgef_oid, + mime_type = mime_type, sequence = dsequence, role = drole, user_file_name = os.path.basename(filename)) else: return None - obj.InitObject(self.CurrentProject.id, self.user.id) + obj.initObject(self.CurrentProject.id, self.user.id) obj.setLocalFilename(filename) return obj @@ -298,11 +296,11 @@ print "NOTE: create tmp role - GDA. Remove RSN" tmp_roles = [] - tmp_role = role.Role() + tmp_role = PgefRole() tmp_role.RoleCode = 'GDA' tmp_role.Userid = username tmp_role.id = username - tmp_role.project_oid = 'H2G2' + tmp_role.project = 'H2G2' tmp_roles.append(tmp_role) self.parent.WatchDog.SetRoles(tmp_roles) @@ -318,11 +316,11 @@ print "Exception: datamanager.login", e return False - except Exception, e: - print "datamanager.login FAILURE" - #import traceback - #traceback.print_exc() - return False +# except Exception, e: +# print "datamanager.login FAILURE" +# #import traceback +# #traceback.print_exc() +# return False def getItemsByProject(self, projectlist): @@ -341,7 +339,7 @@ # need to make sure we get all the referenced objects filled in. pass in objs print "NOTE: user is smallberries for testing" - fieldnames = {"owner_oid" : "smallberries"} #self.user.id} # testing only - remove RSN + fieldnames = {"owner" : "smallberries"} #self.user.id} # testing only - remove RSN docs = self.server.getObjects("Document", fields = fieldnames, refs = 0, subtypes = 0, @@ -349,7 +347,7 @@ #print "docs", docs # do we need to connect docs with parts/models? - fieldnames = {"project_oid" : projectlist[0]} + fieldnames = {"project" : projectlist[0]} parts = self.server.getObjects("Part", fields = fieldnames, refs = 1, subtypes = 0, @@ -479,12 +477,12 @@ project_objs = [] allprojlist = self.localDB.GetProjectObjects() if allprojlist.has_key(self.CurrentProject.id): - project_oids = allprojlist[self.CurrentProject.id] - for poid in project_oids: + projects = allprojlist[self.CurrentProject.id] + for poid in projects: obj = self.localDB.getLookupObject(poid) project_objs.append(obj) - keydict = {"assembly_oid" : tmp_obj.pgef_oid} + keydict = {"assembly" : tmp_obj.pgef_oid} objlist = self.server.getLinkedObjs("Acu", keydict, project_objs) return objlist @@ -510,13 +508,13 @@ modelobjs = [] for obj in objlist: - if obj.IsEmpty(): + if obj.isEmpty(): continue classname = obj.__class__.__name__ if classname == "Acu": nauoobjs.append(obj) - #print obj._assembly.id, "->", obj._component.id + #print obj.assembly.id, "->", obj.component.id elif classname == "Part": itemobjs.append(obj) elif classname == "Model": @@ -553,7 +551,7 @@ localacus = self.localDB.GetLocalAcus(project) retlist = [] for acu_id, acuobj in localacus.items(): - if acuobj._assembly.pgef_oid == assemblyId: + if acuobj.assembly == assemblyId: retlist.append(acuobj) return retlist @@ -598,7 +596,7 @@ documentobjs = [] for obj in objlist: - if obj.IsEmpty(): + if obj.isEmpty(): continue classname = obj.__class__.__name__ @@ -707,21 +705,21 @@ pass except: tmplist.append(acu_to_add.pgef_oid) - self.nauoIDs["ROOT"] = {acu_to_add._assembly.pgef_oid : tmplist} + self.nauoIDs["ROOT"] = {acu_to_add.assembly : tmplist} else: self.nauoIDs["ROOT"] = {"TOPLEVEL" : [acu_to_add.pgef_oid]} elif acu_parent == "TOPLEVEL": - if self.nauoIDs.has_key(acu_to_add._assembly.pgef_oid): - tmpdict = self.nauoIDs[acu_to_add._assembly.pgef_oid] + if self.nauoIDs.has_key(acu_to_add.assembly): + tmpdict = self.nauoIDs[acu_to_add.assembly] try: tmplist = tmpdict[acu_parent] except: tmplist = [] tmplist.append(acu_to_add.pgef_oid) tmpdict[acu_parent] = tmplist - self.nauoIDs[acu_to_add._assembly.pgef_oid] = tmpdict + self.nauoIDs[acu_to_add.assembly] = tmpdict try: if tmplist.index(acu_to_add.pgef_oid): @@ -729,11 +727,11 @@ except: tmplist.append(acu_to_add.pgef_oid) tmpdict[acu_parent] = tmplist - self.nauoIDs[acu_to_add._assembly.pgef_oid] = tmpdict + self.nauoIDs[acu_to_add.assembly] = tmpdict - elif self.nauoIDs.has_key(acu_to_add._assembly.pgef_oid): + elif self.nauoIDs.has_key(acu_to_add.assembly): #print "adding to existing dict" - tmpdict = self.nauoIDs[acu_to_add._assembly.pgef_oid] + tmpdict = self.nauoIDs[acu_to_add.assembly] tmplist = tmpdict[acu_parent.pgef_oid] try: if tmplist.index(acu_to_add.pgef_oid): @@ -741,14 +739,14 @@ except: tmplist.append(acu_to_add.pgef_oid) tmpdict[acu_parent.pgef_oid] = tmplist - self.nauoIDs[acu_to_add._assembly.pgef_oid] = tmpdict + self.nauoIDs[acu_to_add.assembly] = tmpdict else: #print "make leaf a branch; i.e., need a new entry in nauoids" newlist = [] newlist.append(acu_to_add.pgef_oid) newdict = {} newdict[acu_parent.pgef_oid] = newlist - self.nauoIDs[acu_parent._component.pgef_oid] = newdict + self.nauoIDs[acu_parent.component] = newdict self.localDB.add([acu_to_add]) self.localDB.addProjectObjects(self.CurrentProject.id, [acu_to_add]) @@ -917,14 +915,14 @@ for obj in unsavedobjs: # check for unset attributes and commit-related stuff #print "checking", obj.id, obj.name - obj.creator_oid = self.user.id - if obj.owner_oid == "": - obj.owner_oid = obj.creator_oid - if obj.modifier_oid == "": - obj.modifier_oid = obj.creator_oid + obj.creator = self.user.id + if obj.owner == "": + obj.owner = obj.creator + if obj.modifier == "": + obj.modifier = obj.creator - print "setting head_flag = True for", obj.__class__.__name__, obj.id - obj.head_flag = True + print "setting is_head = True for", obj.__class__.__name__, obj.id + obj.is_head = True if obj.state == objectstatus.DELETE: obj.mod_datetime = time.strftime("%m/%d/%Y %H:%M:%S") dellist.append(obj) @@ -1010,26 +1008,26 @@ return objdict.values() - def getUncommittedAlerts(self): - uncommobjs = self.localDB.getUncommittedAlerts() - return uncommobjs - - def uncommittedAlerts(self): - #print "uncommittedalerts" - - uncommobjs = self.localDB.getUncommittedAlerts() - objlen = len(uncommobjs) - if objlen > 0: - for obj in uncommobjs: -# print "obj", obj.id - if isinstance(obj, PgefAdvisory): -# print "true" - return True -# print "false1" - return False - else: -# print "false2" - return False +# def getUncommittedAlerts(self): +# uncommobjs = self.localDB.getUncommittedAlerts() +# return uncommobjs +# +# def uncommittedAlerts(self): +# #print "uncommittedalerts" +# +# uncommobjs = self.localDB.getUncommittedAlerts() +# objlen = len(uncommobjs) +# if objlen > 0: +# for obj in uncommobjs: +# # print "obj", obj.id +# if isinstance(obj, PgefAdvisory): +# # print "true" +# return True +# # print "false1" +# return False +# else: +# # print "false2" +# return False def translateAttrinfo(self, attrinfo): @@ -1098,7 +1096,7 @@ #print "dm.getfiles", obj_list pgefoids = [a.pgef_oid for a in obj_list] - attrlist = [("parent_oid", "in", pgefoids)] + attrlist = [("parent", "in", pgefoids)] classattrdict = {"PgefFile" : attrlist} objs_to_link = [] @@ -1162,8 +1160,8 @@ else: #if obj.__class__.__name__ == "PgefFile": fileaddlist.append(obj) - print "setting head_flag = True for", obj.__class__.__name__, obj.id - obj.head_flag = True + print "setting is_head = True for", obj.__class__.__name__, obj.id + obj.is_head = True actionlist = [] print "alertaddlist:", alertaddlist @@ -1235,8 +1233,8 @@ else: #if obj.__class__.__name__ == "PgefFile": fileaddlist.append(obj) - print "setting head_flag = True for", obj.__class__.__name__, obj.id - obj.head_flag = True + print "setting is_head = True for", obj.__class__.__name__, obj.id + obj.is_head = True actionlist = [] print "wfaddlist:", wfaddlist Index: PanGalactic/pangalactic/utils/dbbrowser.py diff -u PanGalactic/pangalactic/utils/dbbrowser.py:1.25 PanGalactic/pangalactic/utils/dbbrowser.py:1.26 --- PanGalactic/pangalactic/utils/dbbrowser.py:1.25 Mon Jul 19 16:07:49 2004 +++ PanGalactic/pangalactic/utils/dbbrowser.py Sun Aug 8 21:41:24 2004 @@ -135,7 +135,11 @@ collection_name = self.GetRootitems().GetStringSelection() if collection_name: tmpsize = wxSize(750, 500) - cfg_frame = toolframe.toolFrame(self, -1, 'Customize DataBase Browser', wxDefaultPosition, tmpsize) + cfg_frame = toolframe.toolFrame(self, + -1, + 'Customize DataBase Browser', + wxDefaultPosition, + tmpsize) cfg_frame.mainpanel = configuregrid.ConfigureGrid(cfg_frame, -1, localdb = self.localDB, collection_name = collection_name, Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.102 PanGalactic/pangalactic/utils/localdb.py:1.103 --- PanGalactic/pangalactic/utils/localdb.py:1.102 Thu Jul 15 15:14:50 2004 +++ PanGalactic/pangalactic/utils/localdb.py Sun Aug 8 21:41:24 2004 @@ -12,31 +12,33 @@ from pangalactic.enterprise.part import Part from pangalactic.enterprise.model import Model from pangalactic.enterprise.acu import Acu +from pangalactic.enterprise.dcu import Dcu from pangalactic.enterprise.partslist import PartsList from pangalactic.enterprise.person import Person -from pangalactic.enterprise.role import Role +from pangalactic.enterprise.pgefrole import PgefRole +from pangalactic.enterprise.pgefrepresentation import PgefRepresentation from pangalactic.enterprise.project import Project from pangalactic.enterprise.document import Document -from pangalactic.enterprise.pgeffile import PgefFile -from pangalactic.enterprise.docptrel import DocPtRel -from pangalactic.enterprise.ontoclass import OntoClass -from pangalactic.enterprise.ontoproperty import OntoProperty from pangalactic.enterprise.organization import Organization +from pangalactic.enterprise.pgeffile import PgefFile + +from pangalactic.meta.ontology import Ontology +from pangalactic.meta.ontoclass import OntoClass +from pangalactic.meta.ontoproperty import OntoProperty -from pangalactic.enterprise.workflow.wfprocesstemplate import WfProcessTemplate from pangalactic.enterprise.workflow.wfprocessinstance import WfProcessInstance from pangalactic.enterprise.workflow.wfactivity import WfActivity from pangalactic.enterprise.workflow.wfeventaudit import WfEventAudit from pangalactic.enterprise.workflow.wftransition import WfTransition -from nars.enterprise.pgefadvisory import PgefAdvisory -from nars.enterprise.nasaadvisory import NasaAdvisory -from nars.enterprise.gidepdmsmsnotice import GidepDmsmsNotice -from nars.enterprise.gidepagencyactionnotice import GidepAgencyActionNotice -from nars.enterprise.gidepproductchangenotice import GidepProductChangeNotice -from nars.enterprise.gidepalert import GidepAlert -from nars.enterprise.gidepproblemadvisory import GidepProblemAdvisory -from nars.enterprise.problemimpactstatement import ProblemImpactStatement +# from nars.enterprise.pgefadvisory import PgefAdvisory +# from nars.enterprise.nasaadvisory import NasaAdvisory +# from nars.enterprise.gidepdmsmsnotice import GidepDmsmsNotice +# from nars.enterprise.gidepagencyactionnotice import GidepAgencyActionNotice +# from nars.enterprise.gidepproductchangenotice import GidepProductChangeNotice +# from nars.enterprise.gidepalert import GidepAlert +# from nars.enterprise.gidepproblemadvisory import GidepProblemAdvisory +# from nars.enterprise.problemimpactstatement import ProblemImpactStatement import pangalactic.utils.objectstatus as objectstatus @@ -55,31 +57,35 @@ admin = 10 user = 1 -PGEF_CLASSES = ["Project", "Acu", "Part", "Model", "Document", "DocPtRel", - "WfActivity", "WfProcessInstance", "WfProcessTemplate", - "WfTransition", "WfEventAudit"] -NARS_CLASSES = ["NasaAdvisory", "GidepAlert", "GidepProblemAdvisory", - "ProblemImpactStatement", "GidepProductChangeNotice", - "GidepAgencyActionNotice", "GidepDmsmsNotice"] -EXCLUDE_CLASSES = ["ACUByAssembly", "DisplayConfig", "Passwd", "UncommittedDocumentIDs", - "OidLookup", "State"] +PGEF_CLASSES = ["Project", "Acu", "Dcu", "Part", "Model", "Document", + "WfActivity", "WfProcessInstance", "WfTransition", + "WfEventAudit"] +### +### PGEF must have no dependence on NARS. +### (NARS should be a configuration option, but shouldn't be mentioned in +### PGEF itself.) +### +# NARS_CLASSES = ["NasaAdvisory", "GidepAlert", "GidepProblemAdvisory", +# "ProblemImpactStatement", "GidepProductChangeNotice", +# "GidepAgencyActionNotice", "GidepDmsmsNotice"] +EXCLUDE_CLASSES = ["ACUByAssembly", "DisplayConfig", "Passwd", + "UncommittedDocumentIDs", "OidLookup", "State"] class LocalStorage: ACUBYASSEMBLY = "ACUByAssembly" ACUDICT = "Acu" + DCU = "Dcu" CATEGORY = "OntoClass" DISPLAY_CONFIG = "DisplayConfig" - DOCPTREL = "DocPtRel" DOCUMENT = "Document" - GIDEPALERT = "GidepAlert" - GIDEPPROBLEMADVISORY = "GidepProblemAdvisory" - GIDEPDMSMSNOTICE = "GidepDmsmsNotice" - GIDEPAGENCYACTIONNOTICE = "GidepAgencyActionNotice" - GIDEPPRODUCTCHANGENOTICE = "GidepProductChangeNotice" + # GIDEPALERT = "GidepAlert" + # GIDEPPROBLEMADVISORY = "GidepProblemAdvisory" + # GIDEPDMSMSNOTICE = "GidepDmsmsNotice" + # GIDEPAGENCYACTIONNOTICE = "GidepAgencyActionNotice" + # GIDEPPRODUCTCHANGENOTICE = "GidepProductChangeNotice" + # NASAADVISORY = "NasaAdvisory" MODEL = "Model" - NASAADVISORY = "NasaAdvisory" - PROBLEMIMPACTSTATEMENT = "ProblemImpactStatement" OIDLOOKUP = "OidLookup" ORGANIZATION = "Organization" PART = "Part" @@ -88,7 +94,7 @@ PGEFFILE = "PgefFile" PROJECT = "Project" PROJECTOBJECTS = "ProjectObjects" - ROLE = "Role" + PGEFROLE = "PgefRole" STATE = "State" UNCOMMITTEDDOCUMENTIDS = "UncommittedDocumentIDs" UNCOMMITTEDOBJECTS = "UncommittedObjects" @@ -97,7 +103,6 @@ WFEVENTAUDIT = "WfEventAudit" # WFPROCESS = "WfProcess" WFPROCESSINSTANCE = "WfProcessInstance" - WFPROCESSTEMPLATE = "WfProcessTemplate" WFTRANSITION = "WfTransition" # tuple fields: @@ -109,16 +114,16 @@ (ACUDICT, 1, user), (CATEGORY, 0, user), (DISPLAY_CONFIG, 1, admin), - (DOCPTREL, 1, admin), + (DCU, 1, admin), (DOCUMENT, 1, user), - (GIDEPAGENCYACTIONNOTICE, 1, user), - (GIDEPALERT, 1, user), - (GIDEPDMSMSNOTICE, 1, user), - (GIDEPPROBLEMADVISORY, 1, user), - (GIDEPPRODUCTCHANGENOTICE, 1, user), + # (GIDEPAGENCYACTIONNOTICE, 1, user), + # (GIDEPALERT, 1, user), + # (GIDEPDMSMSNOTICE, 1, user), + # (GIDEPPROBLEMADVISORY, 1, user), + # (GIDEPPRODUCTCHANGENOTICE, 1, user), (MODEL, 1, user), - (NASAADVISORY, 1, user), - (PROBLEMIMPACTSTATEMENT, 1, user), + # (NASAADVISORY, 1, user), + # (PROBLEMIMPACTSTATEMENT, 1, user), (OIDLOOKUP, 1, god), (ORGANIZATION, 0, user), (PART, 1, user), @@ -127,7 +132,7 @@ (PGEFFILE, 1, god), (PROJECT, 0, admin), (PROJECTOBJECTS, 0, god), - (ROLE, 0, admin), + (PGEFROLE, 0, admin), (STATE, 0, god), (UNCOMMITTEDDOCUMENTIDS, 1, god), (UNCOMMITTEDOBJECTS, 1, user), @@ -136,40 +141,38 @@ (WFEVENTAUDIT, 1, admin), # (WFPROCESS, 1, user), (WFPROCESSINSTANCE, 1, user), - (WFPROCESSTEMPLATE, 1, admin), (WFTRANSITION, 1, user)] DictListNames = [x for x, y, z in dictlist] CommittedDicts = [ACUDICT, - DOCPTREL, + DCU, DOCUMENT, MODEL, PART, PARTSLIST, - NASAADVISORY, - GIDEPALERT, - GIDEPPROBLEMADVISORY, - GIDEPAGENCYACTIONNOTICE, - GIDEPDMSMSNOTICE, - GIDEPPRODUCTCHANGENOTICE, - PROBLEMIMPACTSTATEMENT, + # NASAADVISORY, + # GIDEPALERT, + # GIDEPPROBLEMADVISORY, + # GIDEPAGENCYACTIONNOTICE, + # GIDEPDMSMSNOTICE, + # GIDEPPRODUCTCHANGENOTICE, + # PROBLEMIMPACTSTATEMENT, PGEFFILE, PROJECT, WFACTIVITY, WFEVENTAUDIT, # WFPROCESS, WFPROCESSINSTANCE, - WFPROCESSTEMPLATE, WFTRANSITION] - alertdicts = [NASAADVISORY, - PROBLEMIMPACTSTATEMENT, - GIDEPPROBLEMADVISORY, - GIDEPALERT, - GIDEPAGENCYACTIONNOTICE, - GIDEPDMSMSNOTICE, - GIDEPPRODUCTCHANGENOTICE] + # alertdicts = [NASAADVISORY, + # PROBLEMIMPACTSTATEMENT, + # GIDEPPROBLEMADVISORY, + # GIDEPALERT, + # GIDEPAGENCYACTIONNOTICE, + # GIDEPDMSMSNOTICE, + # GIDEPPRODUCTCHANGENOTICE] def __init__(self, deletefiles = None): if not os.path.exists("data"): @@ -238,13 +241,13 @@ # print "localdb.saveroles" if RolesList: try: - for key, value in self.dbroot[self.ROLE].items(): - del self.dbroot[self.ROLE][key] + for key, value in self.dbroot[self.PGEFROLE].items(): + del self.dbroot[self.PGEFROLE][key] except: pass for obj in RolesList: - self.saveItNoLookup(self.ROLE, obj, True) + self.saveItNoLookup(self.PGEFROLE, obj, True) def savePasswds(self, login_pwd, new_pwd): @@ -292,10 +295,10 @@ self.getDefaultDisplayMap(Acu._default_display_names, Acu._default_display_order, Acu._default_display_types) - current_config["DocPtRel"] = \ - self.getDefaultDisplayMap(DocPtRel._default_display_names, - DocPtRel._default_display_order, - DocPtRel._default_display_types) + current_config["Dcu"] = \ + self.getDefaultDisplayMap(Dcu._default_display_names, + Dcu._default_display_order, + Dcu._default_display_types) current_config["Document"] = \ self.getDefaultDisplayMap(Document._default_display_names, Document._default_display_order, @@ -303,15 +306,15 @@ current_config["Model"] = \ self.getDefaultDisplayMap(Model._default_display_names, Model._default_display_order, - Model._default_display_types) - current_config["OntoClass"] = \ - self.getDefaultDisplayMap(OntoClass._default_display_names, - OntoClass._default_display_order, - OntoClass._default_display_types) - current_config["OntoProperty"] = \ - self.getDefaultDisplayMap(OntoProperty._default_display_names, - OntoProperty._default_display_order, - OntoProperty._default_display_types) + Model._default_display_types) +# current_config["OntoClass"] = \ +# self.getDefaultDisplayMap(OntoClass._default_display_names, +# OntoClass._default_display_order, +# OntoClass._default_display_types) +# current_config["OntoProperty"] = \ +# self.getDefaultDisplayMap(OntoProperty._default_display_names, +# OntoProperty._default_display_order, +# OntoProperty._default_display_types) current_config["Organization"] = \ self.getDefaultDisplayMap(Organization._default_display_names, Organization._default_display_order, @@ -336,46 +339,46 @@ self.getDefaultDisplayMap(PgefObject._default_display_names, PgefObject._default_display_order, PgefObject._default_display_types) - current_config["PgefAdvisory"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["NasaAdvisory"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["GidepProblemAdvisory"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["GidepAlert"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["GidepAgencyActionNotice"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["GidepDmsmsNotice"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["GidepProductChangeNotice"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) - current_config["ProblemImpactStatement"] = \ - self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - PgefAdvisory._default_display_order, - PgefAdvisory._default_display_types) + # current_config["PgefAdvisory"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["NasaAdvisory"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["GidepProblemAdvisory"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["GidepAlert"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["GidepAgencyActionNotice"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["GidepDmsmsNotice"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["GidepProductChangeNotice"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) + # current_config["ProblemImpactStatement"] = \ + # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, + # PgefAdvisory._default_display_order, + # PgefAdvisory._default_display_types) current_config["Project"] = \ self.getDefaultDisplayMap(Project._default_display_names, Project._default_display_order, Project._default_display_types) - current_config["Role"] = \ - self.getDefaultDisplayMap(Role._default_display_names, - Role._default_display_order, - Role._default_display_types) + current_config["PgefRole"] = \ + self.getDefaultDisplayMap(PgefRole._default_display_names, + PgefRole._default_display_order, + PgefRole._default_display_types) current_config["User"] = \ self.getDefaultDisplayMap(Person._default_display_names, Person._default_display_order, @@ -384,10 +387,6 @@ self.getDefaultDisplayMap(WfActivity._default_display_names, WfActivity._default_display_order, WfActivity._default_display_types) - current_config["WfProcessTemplate"] = \ - self.getDefaultDisplayMap(WfProcessTemplate._default_display_names, - WfProcessTemplate._default_display_order, - WfProcessTemplate._default_display_types) current_config["WfProcessInstance"] = \ self.getDefaultDisplayMap(WfProcessInstance._default_display_names, WfProcessInstance._default_display_order, @@ -455,8 +454,8 @@ if nobj.state: # <> objectstatus.DELETE: pass else: - childobj = self.getLookupObject(nobj._component.pgef_oid) - if currentproject and childobj.project_oid == currentproject.id: + childobj = self.getLookupObject(nobj.component) + if currentproject and childobj.project == currentproject.id: # add project_context = "DEMO" or something similar to the above line - TBD objdict[nid] = nobj @@ -464,8 +463,8 @@ if nobj.__class__.__name__ == "Acu": if objdict.has_key(nid): if nobj.state <> objectstatus.DELETE: - childobj = self.getLookupObject(nobj._component.pgef_oid) - if currentproject and childobj.project_oid == currentproject.id: + childobj = self.getLookupObject(nobj.component) + if currentproject and childobj.project == currentproject.id: objdict[nid] = nobj else: objdict[nid] = nobj @@ -473,8 +472,8 @@ del objdict[nid] else: if nobj.state <> objectstatus.DELETE: - childobj = self.getLookupObject(nobj._component.pgef_oid) - if currentproject and childobj.project_oid == currentproject.id: + childobj = self.getLookupObject(nobj.component) + if currentproject and childobj.project == currentproject.id: objdict[nid] = nobj else: objdict[nid] = nobj @@ -495,14 +494,14 @@ acudict = self.GetLocalAcus(project) retobj = None for acuid, acuobj in acudict.items(): - if acuobj._component.pgef_oid == component.pgef_oid: + if acuobj.component == component.pgef_oid: retobj = acuobj return retobj def GetLocalPartDocLinks(self, currentproject = None): #print "getlocalpartdoclinks" - pdr_dict = self.dbroot[self.DOCPTREL] + pdr_dict = self.dbroot[self.DCU] uncommitted_dict = self.GetUncommittedDict() objdict = {} @@ -512,7 +511,7 @@ #print "skipping deleted pdr", pdrid else: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project_oid == currentproject: + if currentproject and parentobj.project == currentproject: objdict[pdrid] = pdrobj for pdrid, pdrobj in uncommitted_dict.items(): @@ -520,7 +519,7 @@ if objdict.has_key(pdrid): if pdrobj.state <> objectstatus.DELETE: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project_oid == currentproject: + if currentproject and parentobj.project == currentproject: objdict[pdrid] = pdrobj # else: # print "skipping pdr", pdrid @@ -531,7 +530,7 @@ else: if pdrobj.state <> objectstatus.DELETE: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project_oid == currentproject: + if currentproject and parentobj.project == currentproject: objdict[pdrid] = pdrobj # else: # print "skipping deleted pdr", pdrid @@ -560,13 +559,13 @@ tmpobj = self.getLookupObject(nobj.pgef_oid) if tmpobj: - if hasattr(tmpobj, "project_oid"): - if currentproject and tmpobj.project_oid == currentproject: -# tmpobj.project = tmpobj.project_oid + if hasattr(tmpobj, "project"): + if currentproject and tmpobj.project == currentproject: +# tmpobj.project = tmpobj.project objdict[nid] = tmpobj elif hasattr(tmpobj, "_project"): if currentproject and tmpobj._project.id == currentproject: - tmpobj.project_oid = tmpobj._project.id + tmpobj.project = tmpobj._project.id objdict[nid] = tmpobj else: objdict[nid] = tmpobj @@ -580,13 +579,13 @@ #print classname, "exists" if nobj.state <> objectstatus.DELETE: #tmpobj = self.getLookupObject(nobj.pgef_oid) - if hasattr(nobj, "project_oid"): - if currentproject and nobj.project_oid == currentproject: -# nobj.project = nobj.project_oid + if hasattr(nobj, "project"): + if currentproject and nobj.project == currentproject: +# nobj.project = nobj.project objdict[nid] = nobj elif hasattr(nobj, "_project"): if currentproject and nobj._project.id == currentproject: - nobj.project_oid = nobj._project.id + nobj.project = nobj._project.id objdict[nid] = nobj else: objdict[nid] = nobj @@ -596,14 +595,14 @@ #print classname, "new", nobj.id if nobj.state <> objectstatus.DELETE: #tmpobj = self.getLookupObject(nobj.pgef_oid) - if hasattr(nobj, "project_oid"): - if currentproject and nobj.project_oid == currentproject: -# nobj.project = nobj.project_oid + if hasattr(nobj, "project"): + if currentproject and nobj.project == currentproject: +# nobj.project = nobj.project objdict[nid] = nobj elif hasattr(nobj, "_project"): if currentproject and nobj._project.id == currentproject: - nobj.project_oid = nobj._project.id + nobj.project = nobj._project.id objdict[nid] = nobj else: @@ -827,18 +826,7 @@ if unsavedlist: for obj in unsavedlist: classname = obj.__class__.__name__ - if classname == "WfProcessTemplate": - # saving a wfprocess is not typical, hence the specific save method - if self.dbroot[self.WFPROCESSTEMPLATE].has_key(obj.pgef_oid): - if self.dbroot[self.WFPROCESSTEMPLATE][obj.pgef_oid].state: - if override: - self.SaveWfProcessTemplate([obj]) - else: - self.SaveWfProcessTemplate([obj]) - else: - self.SaveWfProcessTemplate([obj]) - - elif classname == "WfProcessInstance": + if classname == "WfProcessInstance": # saving a wfprocess is not typical, hence the specific save method if self.dbroot[self.WFPROCESSINSTANCE].has_key(obj.pgef_oid): if self.dbroot[self.WFPROCESSINSTANCE][obj.pgef_oid].state: @@ -920,7 +908,6 @@ objlist = [] wfobj_types = ["WfProcessInstance", "WfActivity", - "WfProcessTemplate", "WfEventAudit"] for objid, obj in uncommittedobjs.items(): @@ -946,20 +933,6 @@ return [] - def getUncommittedWorkflowTemplates(self): - try: - uncommittedobjs = self.dbroot[self.UNCOMMITTEDOBJECTS] - objlist = [] - for objid, obj in uncommittedobjs.items(): - if obj.__class__.__name__ == "WfProcessTemplate": -# if obj.wfdata == None: - objlist.append(obj) - return objlist - except: - print "no uncommitted workflow templates; returning empty list" - return [] - - def GetWorkflows(self, attrlist = None): print "localdb.getworkflows" wf_dict = self.getDict(self.WFPROCESSINSTANCE) @@ -1000,46 +973,6 @@ return objdict - def GetLocalWorkflowTemplates(self): - #print "localdb.getlocalworkflowtemplates" - wf_dict = self.getDict(self.WFPROCESSTEMPLATE) - uncommitted = self.getUncommittedWorkflowTemplates() - uncommitted_dict = {} - for wf in uncommitted: - uncommitted_dict[wf.pgef_oid] = wf - - objdict = {} - for wfid, wfobj in wf_dict.items(): - if wfobj.state <> objectstatus.DELETE: - tmpobj = self.getLocalObject(self.WFPROCESSTEMPLATE, wfobj.pgef_oid) - elif tmpobj.state == None: - tmpobj = self.getLocalObject(self.WFPROCESSTEMPLATE, wfobj.pgef_oid) - - if tmpobj: - objdict[wfid] = tmpobj - - for wfid, wfobj in uncommitted_dict.items(): - if wfobj.__class__.__name__ == "WfProcessTemplate": - if objdict.has_key(wfid): - if wfobj.state <> objectstatus.DELETE: - tmpobj = self.getLocalObject(self.WFPROCESSTEMPLATE, wfobj.pgef_oid) - objdict[wfid] = tmpobj - else: - del objdict[wfid] - else: - if wfobj.state <> objectstatus.DELETE: - tmpobj = self.getLocalObject(self.WFPROCESSTEMPLATE, wfobj.pgef_oid) - objdict[wfid] = tmpobj - - # else: - # print "skipping deleted wf", wfid - #else: - # print "skipping nonwf" - - return objdict - - - def SaveWfProcessInstance(self, wflist, recurse = False): #print "localdb.SaveWfProcessInstance" for wfobj in wflist: @@ -1056,40 +989,12 @@ self.Commit() - def SaveWfProcessTemplate(self, wflist, recurse = False): - #print "localdb.SaveWfProcessTemplate" - for wfobj in wflist: - self.saveItWithLookup(self.WFPROCESSTEMPLATE, wfobj, True) - - if recurse: - for akey, avalue in wfobj.activities.items(): - #print "activity", akey, avalue.id, avalue.name, avalue.fields - self.saveItWithLookup(self.WFACTIVITY, avalue, True) - for tkey, tvalue in wfobj.transitions_dict.items(): - self.saveItWithLookup(self.WFTRANSITION, tvalue, True) - self.Commit() - - def addWfProcessInstance(self, wflist, recurse = False): #print "localdb.addWfProcessInstance" for wfobj in wflist: self.saveItWithLookup(self.UNCOMMITTEDOBJECTS, wfobj, True) for entry in wfobj.history: self.saveItWithLookup(self.UNCOMMITTEDOBJECTS, entry, True) - - if recurse: - for akey, avalue in wfobj.activities.items(): - #print "activity", akey, avalue.id, avalue.name, avalue.fields - self.saveItWithLookup(self.UNCOMMITTEDOBJECTS, avalue, True) - for tkey, tvalue in wfobj.transitions_dict.items(): - self.saveItWithLookup(self.UNCOMMITTEDOBJECTS, tvalue, True) - self.Commit() - - - def addWfProcessTemplate(self, wflist, recurse = False): - #print "localdb.addWfProcessTemplate" - for wfobj in wflist: - self.saveItWithLookup(self.UNCOMMITTEDOBJECTS, wfobj, True) if recurse: for akey, avalue in wfobj.activities.items(): Index: PanGalactic/pangalactic/utils/pgefexceptions.py diff -u PanGalactic/pangalactic/utils/pgefexceptions.py:1.3 PanGalactic/pangalactic/utils/pgefexceptions.py:1.4 --- PanGalactic/pangalactic/utils/pgefexceptions.py:1.3 Fri Mar 5 16:18:16 2004 +++ PanGalactic/pangalactic/utils/pgefexceptions.py Sun Aug 8 21:41:24 2004 @@ -1,8 +1,8 @@ """PGEF-specific exception classes.""" -# $Id: pgefexceptions.py,v 1.3 2004/03/05 21:18:16 waterbug Exp $ +# $Id: pgefexceptions.py,v 1.4 2004/08/09 01:41:24 waterbug Exp $ -__version__ = "$Revision: 1.3 $"[11:-2] +__version__ = "$Revision: 1.4 $"[11:-2] class PgefError(Exception): """Parent of PGEF exception classes""" @@ -27,10 +27,9 @@ def __init__(self, value=None): PgefError.__init__(self, value=value) -class PermissionError(PgefError): +class PermissionError(ValueError): """Raised when the attempted operation is not authorized by the user's permissions""" - def __init__(self, value=None): - PgefError.__init__(self, value=value) - + def __init__(self, value): + ValueError.__init__(self, value) Index: PanGalactic/pangalactic/utils/sql.py diff -u PanGalactic/pangalactic/utils/sql.py:1.18 PanGalactic/pangalactic/utils/sql.py:1.19 --- PanGalactic/pangalactic/utils/sql.py:1.18 Thu Jun 10 02:11:02 2004 +++ PanGalactic/pangalactic/utils/sql.py Sun Aug 8 21:41:24 2004 @@ -1,6 +1,6 @@ """SQL Tools""" -# $Id: sql.py,v 1.18 2004/06/10 06:11:02 waterbug Exp $ +# $Id: sql.py,v 1.19 2004/08/09 01:41:24 waterbug Exp $ import re import string @@ -32,9 +32,8 @@ all records that match any value in the list). @type kw: string, list, or tuple - @param kw: I{orderby} specifies an order-by clause. Can - be either a string (a column name) or a list or - tuple of column names. + @param kw: I{orderby} specifies an order-by clause. Must + be a list or tuple of column names. @rtype: tuple @return: SQL command string + (optional) arg list @@ -64,9 +63,15 @@ # the sequence string as part of the query string ... if isinstance(value, (list, tuple)): if operator.lower() in ['in', 'not in']: - sqlstmt += """ %s %s """ % (colname, operator) - sqlstmt += """%s %s""" % (str(tuple(value)), - connector) + if len(value) > 1: + sqlstmt += """ %s %s """ % (colname, operator) + sqlstmt += """%s %s""" % (str(tuple(value)), + connector) + else: + # special case for value-list containing one item: use + # 'SELECT ... WHERE colname = [the item]'. + sqlstmt += """ %s = %%s %s""" % (colname, connector) + arl.append(value[0]) else: # special case: 'IS [NOT] NULL' if (type(value) == StringType @@ -111,14 +116,17 @@ def buildSelectFromRowKey(rowkey): """ - Build arguments for a select from a rowkey. - - @type rowkey: list - @param rowkey: a rowkey has the structure: - [tablename, pgef_oid]. + Build arguments for a select from a rowkey, which is simply a + tuple of the form (tablename, pgef_oid). + + @type rowkey: list or tuple + @param rowkey: (tablename, pgef_oid) + + @rtype: tuple + @return: a tuple usable as the *args for runQuery. """ - args = [('pgef_oid', '=', rowkey[1])] - return buildSelect(rowkey[0], 0, *args) + table, pgef_oid = rowkey + return buildSelect(table, 0, ('_pgef_oid', '=', pgef_oid)) def buildInsert(table, parmdict): """ @@ -159,9 +167,9 @@ @type updates: list or dictionary @param updates: column/values for the row(s) to be updated - @type where: dictionary - @param where: a dictionary of the form: - - {colname : value, ...} + @type where: list + @param where: a list of tuples of the form: + - [(colname, operator, value), ...] @rtype: tuple @return: a valid set of args for PgSQL.execute() (consisting @@ -221,6 +229,7 @@ parms.append(value) sqlstmt = re.sub(conn_re, '', sqlstmt) updateargs = (sqlstmt, tuple(parms)) + # print updateargs return updateargs def buildTransactionalInsert(records): Index: PanGalactic/pangalactic/utils/userinfo.py diff -u PanGalactic/pangalactic/utils/userinfo.py:1.4 PanGalactic/pangalactic/utils/userinfo.py:1.5 --- PanGalactic/pangalactic/utils/userinfo.py:1.4 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/userinfo.py Sun Aug 8 21:41:24 2004 @@ -77,9 +77,9 @@ x500_number = self.getX500Wgt().GetValue() foo = self.getTypeWgt().GetSelection() - god_flag = False + god = False if foo == 0: - god_flag = True + god = True elif foo == 1: email = "admin" @@ -106,7 +106,7 @@ self.getPhoneWgt().SetValue(user_info.phone) self.getX500Wgt().SetValue(str(user_info.x500_number)) self.getRoleWgt().SetSelection(0) - if user_info.god_flag: + if user_info.god: self.getTypeWgt().SetSelection(0) elif user_info.id == "admin": self.getTypeWgt().SetSelection(1) From waterbug at ned.gsfc.nasa.gov Sun Aug 8 21:48:51 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 21:48:53 2004 Subject: [Pangalactic-commits] Beginning of server test reorg. Message-ID: <200408090148.i791mp2H017495@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/IDTEST 1.49 1.50 PanGalactic/pangalactic/test/README 1.30 1.31 PanGalactic/pangalactic/test/test_factory_extractAll.py 1.1 1.2 PanGalactic/pangalactic/test/test_factory_remember.py 1.1 1.2 PanGalactic/pangalactic/test/test_factory_rememberAll.py 1.2 1.3 PanGalactic/pangalactic/test/test_pger_addFile.py 1.3 1.4 PanGalactic/pangalactic/test/test_pger_addVersions.py 1.1 1.2 PanGalactic/pangalactic/test/test_pger_changePasswd.py 1.5 1.6 PanGalactic/pangalactic/test/test_registry.py 1.10 1.11 PanGalactic/pangalactic/test/test_sql.py 1.21 1.22 PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py 1.3 1.4 PanGalactic/pangalactic/test/test_xmlrpc_search.py 1.5 1.6 PanGalactic/pangalactic/test/test_db_addRow.py 1.1 None PanGalactic/pangalactic/test/test_db_addRows.py 1.1 None PanGalactic/pangalactic/test/test_db_getByRowKey.py 1.8 None PanGalactic/pangalactic/test/test_db_runquery.py 1.15 None PanGalactic/pangalactic/test/test_db_runsequencequery.py 1.7 None PanGalactic/pangalactic/test/test_db_updateRow.py 1.1 None PanGalactic/pangalactic/test/test_db_updaterow.py 1.3 None PanGalactic/pangalactic/test/test_factory_extract2Record.py 1.8 None PanGalactic/pangalactic/test/test_factory_extractall.py 1.5 None PanGalactic/pangalactic/test/test_factory_makeObjects.py 1.7 None PanGalactic/pangalactic/test/test_factory_record2RowKey.py 1.8 None PanGalactic/pangalactic/test/test_factory_sync.py 1.11 None PanGalactic/pangalactic/test/test_factory_test.py 1.9 None Log message: Beginning of server test reorg. Index: PanGalactic/pangalactic/test/test_pger_addFile.py diff -u PanGalactic/pangalactic/test/test_pger_addFile.py:1.3 PanGalactic/pangalactic/test/test_pger_addFile.py:1.4 --- PanGalactic/pangalactic/test/test_pger_addFile.py:1.3 Tue May 18 12:45:42 2004 +++ PanGalactic/pangalactic/test/test_pger_addFile.py Sun Aug 8 21:48:49 2004 @@ -1,4 +1,4 @@ -# $Id: test_pger_addFile.py,v 1.3 2004/05/18 16:45:42 waterbug Exp $ +# $Id: test_pger_addFile.py,v 1.4 2004/08/09 01:48:49 waterbug Exp $ """ Functional test for pangalactic.repo.pger.Pger.addFile() @@ -10,7 +10,6 @@ import base64 from pprint import pprint from twisted.internet import reactor -from twisted.enterprise import adbapi from pangalactic.utils import oid from pangalactic.repo.pger import Pger from pangalactic.enterprise.project import Project @@ -47,10 +46,8 @@ print error reactor.stop() -added = PGER.addFile('admin', headers, text) -print added +added = PGER.addFile('test', headers, text) +added.addCallbacks(success, failure) reactor.run() -time.sleep(1) -reactor.stop() Index: PanGalactic/pangalactic/test/test_factory_rememberAll.py diff -u PanGalactic/pangalactic/test/test_factory_rememberAll.py:1.2 PanGalactic/pangalactic/test/test_factory_rememberAll.py:1.3 --- PanGalactic/pangalactic/test/test_factory_rememberAll.py:1.2 Thu Jul 8 14:11:21 2004 +++ PanGalactic/pangalactic/test/test_factory_rememberAll.py Sun Aug 8 21:48:49 2004 @@ -2,7 +2,7 @@ from pangalactic.meta.factory import PanGalacticFactory as PGF from pangalactic.meta.ontoclass import OntoClass as OC from pangalactic.meta.ontoproperty import OntoProperty as OP -from pangalactic.enterprise.mimetype import MimeType +from pangalactic.enterprise.mime import Mime from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.enterprise.project import Project from pangalactic.enterprise.part import Part @@ -10,47 +10,47 @@ fac = PGF() -mime1 = MimeType(media_type='model', media_subtype='p21') -fac.reg.popTestData(mime1) +mime1 = Mime(media_type='model', media_subtype='p21') +fac._registry.popTestData(mime1) file1 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy.p21', bytes=42000, mime_type=mime1) -fac.reg.popTestData(file1) +fac._registry.popTestData(file1) file2 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy_libpart1.p21', bytes=12345, mime_type=mime1) -fac.reg.popTestData(file2) +fac._registry.popTestData(file2) p = Project(pgef_oid='TEST.Project.OTHEROTHER', id='OTHEROTHER', id_context='TEST', name='The Other Other Project') -fac.reg.popTestData(p) +fac._registry.popTestData(p) pt1 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='A', iteration=0, name='Part 1A', project=p) -fac.reg.popTestData(pt1) +fac._registry.popTestData(pt1) pt2 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='B', iteration=1, name='Part 1B', project=p) -fac.reg.popTestData(pt2) +fac._registry.popTestData(pt2) mo1 = Model(of_part=pt1, id='M1', name='Model 1') -fac.reg.popTestData(mo1) +fac._registry.popTestData(mo1) mo2 = Model(of_part=pt1, id='M2', name='Model 2') -fac.reg.popTestData(mo2) +fac._registry.popTestData(mo2) mo3 = Model(of_part=pt2, id='M3', name='Model 3') -fac.reg.popTestData(mo3) +fac._registry.popTestData(mo3) mo4 = Model(of_part=pt2, id='M4', name='Model 4', rep_files=[file1, file2]) -fac.reg.popTestData(mo4) +fac._registry.popTestData(mo4) print '=========================================================' print 'Test objects are:' print """p = Project(id='OTHEROTHER', id_context='TEST', name='The Other Other Project')""" print """pt1 = Part(id='x1', version='A', id_context='TEST', name='Part 1A', _project=p)""" print """pt2 = Part(id='x1', version='B', id_context='TEST', name='Part 1B', _project=p)""" -print """mo1 = Model(_of_part=pt1, id='M1', name='Model 1')""" -print """mo2 = Model(_of_part=pt1, id='M2', name='Model 2')""" -print """mo3 = Model(_of_part=pt2, id='M3', name='Model 3')""" -print """mo4 = Model(_of_part=pt2, id='M4', name='Model 4')""" +print """mo1 = Model(of_part=pt1, id='M1', name='Model 1')""" +print """mo2 = Model(of_part=pt1, id='M2', name='Model 2')""" +print """mo3 = Model(of_part=pt2, id='M3', name='Model 3')""" +print """mo4 = Model(of_part=pt2, id='M4', name='Model 4')""" print '=========================================================' print print """Command: fac.extractAll([mo1, mo2, mo3, mo4])""" Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.49 PanGalactic/pangalactic/test/IDTEST:1.50 --- PanGalactic/pangalactic/test/IDTEST:1.49 Tue Jul 13 14:31:46 2004 +++ PanGalactic/pangalactic/test/IDTEST Sun Aug 8 21:48:49 2004 @@ -1 +1 @@ -588 \ No newline at end of file +826 \ No newline at end of file Index: PanGalactic/pangalactic/test/test_pger_addVersions.py diff -u PanGalactic/pangalactic/test/test_pger_addVersions.py:1.1 PanGalactic/pangalactic/test/test_pger_addVersions.py:1.2 --- PanGalactic/pangalactic/test/test_pger_addVersions.py:1.1 Fri May 28 09:41:28 2004 +++ PanGalactic/pangalactic/test/test_pger_addVersions.py Sun Aug 8 21:48:49 2004 @@ -34,9 +34,9 @@ # create test objects pt = Part(pgef_oid=ptoid, id=ptid, id_context='TEST', - name=ptname, project_oid=projoid) + name=ptname, project=projoid) pt.popTestData() -m = Model(pgef_oid=moid, _of_part=pt, id=mid, name=mname) +m = Model(pgef_oid=moid, of_part=pt, id=mid, name=mname) m.popTestData() extract = PGER._factory.extract Index: PanGalactic/pangalactic/test/test_pger_changePasswd.py diff -u PanGalactic/pangalactic/test/test_pger_changePasswd.py:1.5 PanGalactic/pangalactic/test/test_pger_changePasswd.py:1.6 --- PanGalactic/pangalactic/test/test_pger_changePasswd.py:1.5 Thu Jul 8 16:50:56 2004 +++ PanGalactic/pangalactic/test/test_pger_changePasswd.py Sun Aug 8 21:48:49 2004 @@ -1,4 +1,4 @@ -# $Id: test_pger_changePasswd.py,v 1.5 2004/07/08 20:50:56 waterbug Exp $ +# $Id: test_pger_changePasswd.py,v 1.6 2004/08/09 01:48:49 waterbug Exp $ """ Functional test for pangalactic.repo.pger.changePassword @@ -18,7 +18,7 @@ print f reactor.stop() -d = pgr.changePassword('sikrit', 'test', 'admin') +d = pgr.changePassword('admin', 'test', 'sikrit') d.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_factory_remember.py diff -u PanGalactic/pangalactic/test/test_factory_remember.py:1.1 PanGalactic/pangalactic/test/test_factory_remember.py:1.2 --- PanGalactic/pangalactic/test/test_factory_remember.py:1.1 Thu Jul 8 14:11:21 2004 +++ PanGalactic/pangalactic/test/test_factory_remember.py Sun Aug 8 21:48:49 2004 @@ -2,7 +2,7 @@ from pangalactic.meta.factory import PanGalacticFactory as PGF from pangalactic.meta.ontoclass import OntoClass as OC from pangalactic.meta.ontoproperty import OntoProperty as OP -from pangalactic.enterprise.mimetype import MimeType +from pangalactic.enterprise.mime import Mime from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.enterprise.project import Project from pangalactic.enterprise.part import Part @@ -10,37 +10,37 @@ fac = PGF() -mime1 = MimeType(media_type='model', media_subtype='p21') -fac.reg.popTestData(mime1) +mime1 = Mime(media_type='model', media_subtype='p21') +fac._registry.popTestData(mime1) file1 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy.p21', bytes=42000, mime_type=mime1) -fac.reg.popTestData(file1) +fac._registry.popTestData(file1) file2 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy_libpart1.p21', bytes=12345, mime_type=mime1) -fac.reg.popTestData(file2) +fac._registry.popTestData(file2) p = Project(pgef_oid='TEST.Project.OTHEROTHER', id='OTHEROTHER', id_context='TEST', name='The Other Other Project') -fac.reg.popTestData(p) +fac._registry.popTestData(p) pt1 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='A', iteration=0, name='Part 1A', project=p) -fac.reg.popTestData(pt1) +fac._registry.popTestData(pt1) pt2 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='B', iteration=1, name='Part 1B', project=p) -fac.reg.popTestData(pt2) +fac._registry.popTestData(pt2) mo1 = Model(of_part=pt1, id='M1', name='Model 1', rep_files=[file1, file2]) -fac.reg.popTestData(mo1) +fac._registry.popTestData(mo1) mo2 = Model(of_part=pt1, id='M2', name='Model 2') -fac.reg.popTestData(mo2) +fac._registry.popTestData(mo2) mo3 = Model(of_part=pt2, id='M3', name='Model 3') -fac.reg.popTestData(mo3) +fac._registry.popTestData(mo3) mo4 = Model(of_part=pt2, id='M4', name='Model 4') -fac.reg.popTestData(mo4) +fac._registry.popTestData(mo4) print '=========================================================' print 'Test objects are:' @@ -58,8 +58,9 @@ ex = fac.extract(mo1) +print '\n==================' print 'Extract of Model 1:' -print +print '==================' pprint(ex) print print '=========================================================' @@ -71,8 +72,9 @@ objs = [p, pt1, pt2, file1, file2, mime1] rembd, objs = fac.remember(ex, objs) +print '\n==================' print 'Model 1 remembered:' -print +print '==================' print rembd[0] print print '=========================================================' Index: PanGalactic/pangalactic/test/test_factory_extractAll.py diff -u PanGalactic/pangalactic/test/test_factory_extractAll.py:1.1 PanGalactic/pangalactic/test/test_factory_extractAll.py:1.2 --- PanGalactic/pangalactic/test/test_factory_extractAll.py:1.1 Thu Jul 8 14:11:21 2004 +++ PanGalactic/pangalactic/test/test_factory_extractAll.py Sun Aug 8 21:48:49 2004 @@ -2,7 +2,7 @@ from pangalactic.meta.factory import PanGalacticFactory as PGF from pangalactic.meta.ontoclass import OntoClass as OC from pangalactic.meta.ontoproperty import OntoProperty as OP -from pangalactic.enterprise.mimetype import MimeType +from pangalactic.enterprise.mime import Mime from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.enterprise.project import Project from pangalactic.enterprise.part import Part @@ -10,47 +10,47 @@ fac = PGF() -mime1 = MimeType(media_type='model', media_subtype='p21') -fac.reg.popTestData(mime1) +mime1 = Mime(media_type='model', media_subtype='p21') +fac._registry.popTestData(mime1) file1 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy.p21', bytes=42000, mime_type=mime1) -fac.reg.popTestData(file1) +fac._registry.popTestData(file1) file2 = PgefFile(role='content', rep_type='STEP', rep_group='STEP 1', user_file_name='thingy_libpart1.p21', bytes=12345, mime_type=mime1) -fac.reg.popTestData(file2) +fac._registry.popTestData(file2) p = Project(pgef_oid='TEST.Project.OTHEROTHER', id='OTHEROTHER', id_context='TEST', name='The Other Other Project') -fac.reg.popTestData(p) +fac._registry.popTestData(p) pt1 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='A', iteration=0, name='Part 1A', _project=p) -fac.reg.popTestData(pt1) +fac._registry.popTestData(pt1) pt2 = Part(id='x1', id_context='TEST.Project.OTHEROTHER', version='B', iteration=1, name='Part 1B', _project=p) -fac.reg.popTestData(pt2) -mo1 = Model(_of_part=pt1, id='M1', name='Model 1') -fac.reg.popTestData(mo1) -mo2 = Model(_of_part=pt1, id='M2', name='Model 2') -fac.reg.popTestData(mo2) -mo3 = Model(_of_part=pt2, id='M3', name='Model 3') -fac.reg.popTestData(mo3) -mo4 = Model(_of_part=pt2, id='M4', name='Model 4', +fac._registry.popTestData(pt2) +mo1 = Model(of_part=pt1, id='M1', name='Model 1') +fac._registry.popTestData(mo1) +mo2 = Model(of_part=pt1, id='M2', name='Model 2') +fac._registry.popTestData(mo2) +mo3 = Model(of_part=pt2, id='M3', name='Model 3') +fac._registry.popTestData(mo3) +mo4 = Model(of_part=pt2, id='M4', name='Model 4', rep_files=[file1, file2]) -fac.reg.popTestData(mo4) +fac._registry.popTestData(mo4) print '=========================================================' print 'Test objects are:' print """p = Project(id='OTHEROTHER', id_context='TEST', name='The Other Other Project')""" print """pt1 = Part(id='x1', version='A', id_context='TEST', name='Part 1A', _project=p)""" print """pt2 = Part(id='x1', version='B', id_context='TEST', name='Part 1B', _project=p)""" -print """mo1 = Model(_of_part=pt1, id='M1', name='Model 1')""" -print """mo2 = Model(_of_part=pt1, id='M2', name='Model 2')""" -print """mo3 = Model(_of_part=pt2, id='M3', name='Model 3')""" -print """mo4 = Model(_of_part=pt2, id='M4', name='Model 4')""" +print """mo1 = Model(of_part=pt1, id='M1', name='Model 1')""" +print """mo2 = Model(of_part=pt1, id='M2', name='Model 2')""" +print """mo3 = Model(of_part=pt2, id='M3', name='Model 3')""" +print """mo4 = Model(of_part=pt2, id='M4', name='Model 4')""" print '=========================================================' print print """Command: fac.extractAll([mo1, mo2, mo3, mo4], ['Project'])""" Index: PanGalactic/pangalactic/test/test_sql.py diff -u PanGalactic/pangalactic/test/test_sql.py:1.21 PanGalactic/pangalactic/test/test_sql.py:1.22 --- PanGalactic/pangalactic/test/test_sql.py:1.21 Thu Jul 8 14:11:22 2004 +++ PanGalactic/pangalactic/test/test_sql.py Sun Aug 8 21:48:49 2004 @@ -1,13 +1,13 @@ -# $Id: test_sql.py,v 1.21 2004/07/08 18:11:22 waterbug Exp $ +# $Id: test_sql.py,v 1.22 2004/08/09 01:48:49 waterbug Exp $ """ Functional tests for pangalactic.utils.sql module """ -from pyPgSQL import PgSQL from pangalactic.utils.sql import buildSelect from pangalactic.utils.sql import buildInsert from pangalactic.utils.sql import buildTransactionalInsert +from mx.DateTime import DateTime from twisted.trial import unittest # TODO: need more test data ... @@ -93,51 +93,50 @@ expected = ('INSERT INTO part (id_context, id) VALUES (%s, %s)', ('TEST', '123')) self.assertEquals(expected, result) - # def test_10_buildTransactionalInsert(self): - # """CASE: build an sql cmd to insert a list of records into a table""" - # from pangalactic.repo.pgerregistry import PgerObjectRegistry as POR - # from pangalactic.repo.pgerfactory import PgerObjectFactory as POF - # from pangalactic.enterprise.project import Project - # from pangalactic.enterprise.part import Part - # from pangalactic.enterprise.model import Model - # - # # get next base number for unique oids, ids - # f = open('IDTEST') - # savedid = f.read() - # testid = str(int(savedid) + 1) - # f.close() - # f = open('IDTEST', 'w') - # f.write(testid) - # f.close() - # - # # generate unique test oids, ids, and names - # projoid = 'OTHER' - # ptid = 'MTPaE-' + testid - # ptoid = 'TEST.MTPaE.Part.MTPaE-' + testid - # ptname = 'MTPaE-' + testid + ' Mr. Dynamo' - # mname = 'MTPaE-' + testid + '-Model, Version A' - # mid = 'MTPaE-' + testid + '-Mechanical-Model' - # moid = 'TEST.MTPaE.Model.MTPaE-' + testid - # - # # create test objects - # pt = Part(pgef_oid=ptoid, id=ptid, id_context='TEST', - # name=ptname, project_oid=projoid) - # pt.popTestData() - # m = Model(pgef_oid=moid, _of_part=pt, id=mid, name=mname) - # m.popTestData() - # - # r = POR() - # f = POF(r) - # - # extracts = f.extractAll([pt, m]) - # recs = [f.extract2Record(e) for e in extracts] - # print - # print 'Records:' - # print recs - # print - # cmd = buildTransactionalInsert(recs) - # print 'Command:' - # print cmd - #expected = ("""""") - #self.assertEquals(expected, cmd) + def test_10_buildTransactionalInsert(self): + """CASE: build an sql cmd to insert a list of records into a table""" + recs = [ + ['_model', + {'_create_datetime': DateTime(2004), + '_creator': 'test', + '_id': 'MTPaE-661-Mechanical-Model', + '_id_context': 'NOCONTEXT', + '_is_head': True, + '_iteration': 0, + '_mod_datetime': DateTime(2004), + '_modifier': 'test', + '_name': 'MTPaE-661-Model, Version A', + '_of_part': 'TEST.MTPaE.Part.MTPaE-661', + '_owner': 'test', + '_pgef_oid': 'TEST.MTPaE.Model.MTPaE-661', + '_pger_creator': 'test', + '_pger_modifier': 'test', + '_pger_owner': 'test', + '_security_mask': 0}], + ['_part', + {'_create_datetime': DateTime(2004), + '_creator': 'test', + '_id': 'MTPaE-661', + '_id_context': 'TEST', + '_is_head': True, + '_iteration': 0, + '_mod_datetime': DateTime(2004), + '_modifier': 'test', + '_name': 'MTPaE-661 Mr. Dynamo', + '_owner': 'test', + '_pgef_oid': 'TEST.MTPaE.Part.MTPaE-661', + '_pger_creator': 'test', + '_pger_modifier': 'test', + '_pger_owner': 'test', + '_quantity': 1, + '_security_mask': 0}] + ] + print 'Records:' + print recs + print + cmd = buildTransactionalInsert(recs) + print 'Command:' + print cmd + #expected = ("""""") + #self.assertEquals(expected, cmd) Index: PanGalactic/pangalactic/test/README diff -u PanGalactic/pangalactic/test/README:1.30 PanGalactic/pangalactic/test/README:1.31 --- PanGalactic/pangalactic/test/README:1.30 Thu Jul 8 14:11:21 2004 +++ PanGalactic/pangalactic/test/README Sun Aug 8 21:48:49 2004 @@ -1,4 +1,4 @@ -$Id: README,v 1.30 2004/07/08 18:11:21 waterbug Exp $ +$Id: README,v 1.31 2004/08/09 01:48:49 waterbug Exp $ Pan Galactic Engineering Framework Test Scripts =============================================== @@ -7,7 +7,7 @@ 1. convert all tests into real unittest-type unit tests so they can be run automatically by the twisted "trial" script. - status: test_sql.py converted. + status: test_sql.py converted. 2. combine all unit tests for each module into a single test module called 'test_[module name].py'. @@ -16,40 +16,47 @@ Prep: These tests require the test data to be loaded into pgerdb -- run the script: Pangalactic/src/sql/populate_pgerdb.sh - (TODO: set up a separate test database: - "testpgerdb") -Graph of tests by module dependencies: +Sequence of tests by module dependencies: -test_glimpse_getfulltext.py -test_sql.py -test_db_runquery.py -test_db_runsequencequery.py -test_db_addRow.py -test_db_addRows.py -test_db_updateRow.py -test_db_getByRowKey.py test_registry.py - \ / - test_factory_sync.py - test_factory_extractAll.py - test_factory_remember.py - test_factory_rememberAll.py - test_factory_extract2Record.py - test_factory_makeObjects.py - test_factory_record2RowKey.py - test_factory_unmakeObject.py - | - test_pger_changePasswd.py - test_pger_get.py - test_pger_getResultSets.py - test_pger_getResultSetsWithRefs.py - test_pger_gettuplers.py - test_pger_getobjects.py - test_pger_getRefdRowKeys.py - test_pger_addExtracts.py - test_pger_addObjects.py - | - test_xmlrpc_getobjects.py - test_xmlrpc_search.py - test_xmlrpc_addobjects.py + test_registry.py + | + test_factory_extractAll.py + test_factory_remember.py + test_factory_rememberAll.py + | + test_sql.py [usage: trial -v test_sql.py] + | + test_chronosynclastic_extracts2Records.py + test_chronosynclastic_makeObjects.py + test_chronosynclastic_record2RowKey.py + test_chronosynclastic_getRefdRowKeys.py + test_chronosynclastic_getResultByRowKey.py + test_chronosynclastic_runQueryMapped.py + test_chronosynclastic_runQueryMapped-sequence.py + test_chronosynclastic_transactionalInsert.py + test_chronosynclastic_addRecords.py + test_chronosynclastic_addObjects.py + test_chronosynclastic_updateObjects.py + | + test_pger_changePasswd.py + test_pger_getObjectsE.py + test_pger_getObjectsO.py + test_pger_findObjects.py + test_pger_addObjectsE.py + test_pger_addObjectsO.py + test_pger_addFile.py + | + test_xmlrpc_changePasswd.py + test_xmlrpc_getObjects.py + test_xmlrpc_search.py + test_xmlrpc_addobjects.py + +------------------------------------------------ + + TESTS TO SKIP: + (waiting for GlimpseServer to come back ...) + + test_glimpse_getfulltext.py + test_pger_gettuplers.py Index: PanGalactic/pangalactic/test/test_registry.py diff -u PanGalactic/pangalactic/test/test_registry.py:1.10 PanGalactic/pangalactic/test/test_registry.py:1.11 --- PanGalactic/pangalactic/test/test_registry.py:1.10 Thu Jul 8 14:11:22 2004 +++ PanGalactic/pangalactic/test/test_registry.py Sun Aug 8 21:48:49 2004 @@ -3,7 +3,7 @@ - outputs result of registry.report() """ -from pangalactic.repo.pgerregistry import PgerObjectRegistry -r = PgerObjectRegistry() +from pangalactic.meta.registry import PanGalacticRegistry +r = PanGalacticRegistry() r.report() Index: PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py:1.3 PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py:1.4 --- PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py:1.3 Thu Jul 8 16:50:56 2004 +++ PanGalactic/pangalactic/test/test_xmlrpc_changePasswd.py Sun Aug 8 21:48:49 2004 @@ -1,10 +1,9 @@ -# $Id: test_xmlrpc_changePasswd.py,v 1.3 2004/07/08 20:50:56 waterbug Exp $ +# $Id: test_xmlrpc_changePasswd.py,v 1.4 2004/08/09 01:48:49 waterbug Exp $ """ Functional test for pangalactic.repo.pgerxmlrpc.changePassword """ -from pprint import pprint from twisted.internet import reactor from pangalactic.repo.pger import Pger from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService Index: PanGalactic/pangalactic/test/test_xmlrpc_search.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.5 PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.6 --- PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.5 Thu Jun 10 01:08:00 2004 +++ PanGalactic/pangalactic/test/test_xmlrpc_search.py Sun Aug 8 21:48:49 2004 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_search.py,v 1.5 2004/06/10 05:08:00 waterbug Exp $ +# $Id: test_xmlrpc_search.py,v 1.6 2004/08/09 01:48:49 waterbug Exp $ """ Functional test for PgerXmlrpcService.search() @@ -9,12 +9,12 @@ from pangalactic.repo.pger import Pger from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService -classname = 'Document' +ocid = 'Part' def success(resultsets): pprint(resultsets) print - print '[ %s %s instances. ]' % (len(resultsets), classname) + print '[ %s %s instances. ]' % (len(resultsets), ocid) print reactor.stop() @@ -25,8 +25,8 @@ pgr = Pger() xmlsrv = PgerXmlrpcService(pgr) -res = xmlsrv.xmlrpc_search(classname, 0, 0, - [('head_flag', 'boolean', 1)] +res = xmlsrv.xmlrpc_search(ocid, 0, 0, + [('owner', 'like', 'bigboote')] ) res.addCallbacks(success, failure) From waterbug at ned.gsfc.nasa.gov Sun Aug 8 21:52:18 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 21:52:20 2004 Subject: [Pangalactic-commits] New tests for the Chronosynclastic Infundibulum. :) Message-ID: <200408090152.i791qIJh017540@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_chronosynclastic_.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_extracts2Records.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_makeObjects.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped-sequence.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_transactionalInsert.py None 1.1 PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py None 1.1 Log message: New tests for the Chronosynclastic Infundibulum. :) From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:01:47 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:01:49 2004 Subject: [Pangalactic-commits] Some more test pruning ... Message-ID: <200408090201.i7921lrU017610@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/README 1.31 1.32 PanGalactic/pangalactic/test/test_pger_addExtracts.py 1.8 None PanGalactic/pangalactic/test/test_pger_addObjects.py 1.10 None PanGalactic/pangalactic/test/test_pger_get.py 1.11 None PanGalactic/pangalactic/test/test_pger_getRefdRowKeys.py 1.8 None PanGalactic/pangalactic/test/test_pger_getResultSets.py 1.11 None PanGalactic/pangalactic/test/test_pger_getResultSetsWithRefs.py 1.9 None PanGalactic/pangalactic/test/test_pger_getobjects.py 1.8 None PanGalactic/pangalactic/test/test_pger_pb.py 1.5 None PanGalactic/pangalactic/test/test_pger_search.py 1.8 None PanGalactic/pangalactic/test/test_pger_verifyAddExtracts.py 1.5 None PanGalactic/pangalactic/test/test_xmlrpc_addobjects.py 1.13 None PanGalactic/pangalactic/test/test_xmlrpc_createobjects.py 1.3 None PanGalactic/pangalactic/test/test_xmlrpc_getobjects.py 1.18 None Log message: Some more test pruning ... Index: PanGalactic/pangalactic/test/README diff -u PanGalactic/pangalactic/test/README:1.31 PanGalactic/pangalactic/test/README:1.32 --- PanGalactic/pangalactic/test/README:1.31 Sun Aug 8 21:48:49 2004 +++ PanGalactic/pangalactic/test/README Sun Aug 8 22:01:46 2004 @@ -1,4 +1,4 @@ -$Id: README,v 1.31 2004/08/09 01:48:49 waterbug Exp $ +$Id: README,v 1.32 2004/08/09 02:01:46 waterbug Exp $ Pan Galactic Engineering Framework Test Scripts =============================================== @@ -55,8 +55,8 @@ ------------------------------------------------ TESTS TO SKIP: - (waiting for GlimpseServer to come back ...) test_glimpse_getfulltext.py test_pger_gettuplers.py + test_pger_addVersions.py From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:05:11 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:05:13 2004 Subject: [Pangalactic-commits] More new and/or renamed tests. Message-ID: <200408090205.i7925BTJ017679@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pger_addObjectsE.py None 1.1 PanGalactic/pangalactic/test/test_pger_addObjectsO.py None 1.1 PanGalactic/pangalactic/test/test_pger_findObjects.py None 1.1 PanGalactic/pangalactic/test/test_pger_getObjectsE.py None 1.1 PanGalactic/pangalactic/test/test_pger_getObjectsO.py None 1.1 PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py None 1.1 PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py None 1.1 PanGalactic/pangalactic/test/README 1.32 1.33 Log message: More new and/or renamed tests. Index: PanGalactic/pangalactic/test/README diff -u PanGalactic/pangalactic/test/README:1.32 PanGalactic/pangalactic/test/README:1.33 --- PanGalactic/pangalactic/test/README:1.32 Sun Aug 8 22:01:46 2004 +++ PanGalactic/pangalactic/test/README Sun Aug 8 22:05:10 2004 @@ -1,4 +1,4 @@ -$Id: README,v 1.32 2004/08/09 02:01:46 waterbug Exp $ +$Id: README,v 1.33 2004/08/09 02:05:10 waterbug Exp $ Pan Galactic Engineering Framework Test Scripts =============================================== @@ -50,7 +50,7 @@ test_xmlrpc_changePasswd.py test_xmlrpc_getObjects.py test_xmlrpc_search.py - test_xmlrpc_addobjects.py + test_xmlrpc_addObjects.py ------------------------------------------------ From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:06:44 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:06:46 2004 Subject: [Pangalactic-commits] And a simple interactive test runner. Message-ID: <200408090206.i7926iRh017717@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/runtests None 1.1 Log message: And a simple interactive test runner. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:17:10 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:17:12 2004 Subject: [Pangalactic-commits] Add all meta stuff. Message-ID: <200408090217.i792HAWu017799@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/__init__.py None 1.1 PanGalactic/pangalactic/meta/factory.py None 1.1 PanGalactic/pangalactic/meta/ontoclass.py None 1.1 PanGalactic/pangalactic/meta/ontology.py None 1.1 PanGalactic/pangalactic/meta/ontoproperty.py None 1.1 PanGalactic/pangalactic/meta/registry.py None 1.1 Log message: Add all meta stuff. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:22:59 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:23:02 2004 Subject: [Pangalactic-commits] Radical renovations to repo. Message-ID: <200408090222.i792Mxrf017875@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/repo/chronosynclastic.py None 1.1 PanGalactic/pangalactic/repo/pger.py 1.84 1.85 PanGalactic/pangalactic/repo/pgercred.py 1.10 1.11 PanGalactic/pangalactic/repo/pgerxmlrpc.py 1.13 1.14 PanGalactic/pangalactic/repo/pgerdb.py 1.11 None PanGalactic/pangalactic/repo/pgerfactory.py 1.11 None PanGalactic/pangalactic/repo/pgerpb.py 1.10 None Log message: Radical renovations to repo. Index: PanGalactic/pangalactic/repo/pgercred.py diff -u PanGalactic/pangalactic/repo/pgercred.py:1.10 PanGalactic/pangalactic/repo/pgercred.py:1.11 --- PanGalactic/pangalactic/repo/pgercred.py:1.10 Fri May 7 01:01:52 2004 +++ PanGalactic/pangalactic/repo/pgercred.py Sun Aug 8 22:22:57 2004 @@ -1,9 +1,9 @@ -# $Id: pgercred.py,v 1.10 2004/05/07 05:01:52 waterbug Exp $ +# $Id: pgercred.py,v 1.11 2004/08/09 02:22:57 waterbug Exp $ """ Authentication and credential management for PGER. -@version: $Revision: 1.10 $ +@version: $Revision: 1.11 $ """ -__version__ = "$Revision: 1.10 $"[11:-2] +__version__ = "$Revision: 1.11 $"[11:-2] import sys import sha @@ -175,8 +175,8 @@ Verify credentials, returning the username if successful. """ res = self.db.runQuery( - """SELECT * from credential where owner_oid = %s - and system_oid = 'PGER' and password = %s""", + """SELECT * from _passwd where _pgef_oid = %s + and _password = %s""", (creds.username, sha.sha(creds.password).hexdigest())) def succeeded(r): Index: PanGalactic/pangalactic/repo/pgerxmlrpc.py diff -u PanGalactic/pangalactic/repo/pgerxmlrpc.py:1.13 PanGalactic/pangalactic/repo/pgerxmlrpc.py:1.14 --- PanGalactic/pangalactic/repo/pgerxmlrpc.py:1.13 Thu Jun 10 01:07:25 2004 +++ PanGalactic/pangalactic/repo/pgerxmlrpc.py Sun Aug 8 22:22:57 2004 @@ -1,10 +1,10 @@ """ PGER XML-RPC Interfaces module -@version: $Revision: 1.13 $ +@version: $Revision: 1.14 $ """ -__version__ = "$Revision: 1.13 $"[11:-2] -# $Id: pgerxmlrpc.py,v 1.13 2004/06/10 05:07:25 waterbug Exp $ +__version__ = "$Revision: 1.14 $"[11:-2] +# $Id: pgerxmlrpc.py,v 1.14 2004/08/09 02:22:57 waterbug Exp $ from twisted.python import log from twisted.web.xmlrpc import XMLRPC @@ -14,17 +14,6 @@ from pangalactic.utils.pgefexceptions import * -def keywordify(args): - """ - I take a tuple of positional args and turn it into a - dictionary of keyword args - """ - kw = {} - for a in args: - alist = a.split('=') - kw[alist[0]] = alist[1] - return kw - class PgerXmlrpcService(XMLRPC): """ I am a Web resource that publishes PGEF Node services @@ -86,31 +75,27 @@ return s - def xmlrpc_getKnownClassNames(self): - return self.engine.getKnownClassNames() - - def xmlrpc_changePassword(self, password, username=''): + def xmlrpc_changePassword(self, password, userid=''): """ - Change password for a username (default: for + Change password for a userid (default: for the authenticated user). @type password: string @param password: new password - @type username: string - @param username: pgef_oid of the Person whose password - is to be changed - """ - return self.engine.changePassword(password, - username, - self.userid) + @type userid: string + @param userid: pgef_oid of the Person whose password is to be + changed + """ + return self.engine.changePassword(self.userid, + userid, + password) def xmlrpc_getObjects(self, typename, refs, subtypes, criteria): """ - XMLRPC getObjects: get the set of objects that exactly - match a specified set of attribute-value pairs, returning - the result as a list of "extracts" -- see - L{pangalactic.utils.factory.extract}) + XMLRPC getObjects: get the set of objects that exactly match a + specified set of attribute-value pairs, returning the result as a + list of "extracts" -- see L{pangalactic.utils.factory.extract}) @type typename: string @param typename: the name of a class that extends @@ -139,28 +124,29 @@ kw = dict(criteria) elif isinstance(criteria, dict): kw = criteria - res = self.engine.getResultSets(typename, self.userid, - refs, subtypes, **kw) - res.addCallback(lambda x: - [self.engine._factory.resultset2Extract(rs) - for rs in x]) + res = self.engine.getObjects(requestor=self.userid, + ocid=typename, + refs=refs, + subtypes=subtypes, + **kw) return res else: return """I'm sorry, Dave, I'm afraid I can't do that.""" - def xmlrpc_search(self, classname, refs, subtypes, args): + def xmlrpc_search(self, ocid, refs, subtypes, args): """ Search for instances of the specified class. - @type classname: string - @param classname: the name of the class of objects to + @type ocid: string + @param ocid: the name of the class of objects to search for (i.e., a subtype of L{pangalactic.enterprise.pgefobject.PgefObject}) @type refs: boolean @param refs: specifies whether to include objects - referenced by the found objects (i.e., those - of classes in their '_refs' attribute). + referenced by the found objects (i.e., + the attributes whose types are classes in the + ontology). 0: (default) do not get refs 1: get all references (in future, refs may specify how many @@ -192,17 +178,8 @@ be done, treating the search value as a substring. """ - res = self.engine.search(classname, self.userid, - refs, subtypes, 0, args) - if refs: - res.addCallback(lambda x: - [self.engine._factory.resultset2Extract(rsl[0]) - for rsl in x]) - else: - res.addCallback(lambda x: - [self.engine._factory.resultset2Extract(rs) - for rs in x]) - return res + return self.engine.findObjects(self.userid, ocid, refs, subtypes, + args=args) # def xmlrpc_getDocuments(self, typename, refs, # subtypes, criteria): @@ -261,7 +238,7 @@ timedate stamps) """ if extracts: - return self.engine.addExtracts(self.userid, extracts) + return self.engine.addObjects(self.userid, extracts) else: return """I'm sorry, Dave, I'm afraid I can't do that.""" Index: PanGalactic/pangalactic/repo/pger.py diff -u PanGalactic/pangalactic/repo/pger.py:1.84 PanGalactic/pangalactic/repo/pger.py:1.85 --- PanGalactic/pangalactic/repo/pger.py:1.84 Thu Jun 10 01:55:32 2004 +++ PanGalactic/pangalactic/repo/pger.py Sun Aug 8 22:22:57 2004 @@ -1,35 +1,31 @@ -# $Id: pger.py,v 1.84 2004/06/10 05:55:32 waterbug Exp $ +# $Id: pger.py,v 1.85 2004/08/09 02:22:57 waterbug Exp $ """ Pan Galactic Entropy Reverser module -@version: $Revision: 1.84 $ +@version: $Revision: 1.85 $ """ -__version__ = "$Revision: 1.84 $"[11:-2] +__version__ = "$Revision: 1.85 $"[11:-2] -import os -import string import sys +import os import sha import base64 -from pprint import pprint from mx import DateTime +from pprint import pprint # Twisted imports ... from twisted.application.service import MultiService -from twisted.enterprise import adbapi from twisted.internet import defer from twisted.python import log from twisted.python import context from twisted.python import reflect -from twisted.spread import pb # PanGalactic imports ... from pangalactic.utils import oid from pangalactic.utils import utils -from pangalactic.repo.pgerdb import PgerDb +from pangalactic.utils import pgefexceptions +from pangalactic.repo.chronosynclastic import Infundibulum from pangalactic.repo.pgercred import UserDbCredChecker -from pangalactic.repo.pgerregistry import PgerObjectRegistry -from pangalactic.repo.pgerfactory import PgerObjectFactory from pangalactic.repo.glimpseserver import GlimpseServer @@ -49,684 +45,310 @@ services. """ - def __init__(self, domains='PanGalactic'): + def __init__(self, domains='PanGalactic', encrypted=0): """ Initializes the Pger MultiService (a local singleton). """ MultiService.__init__(self) self.setName('PGER') - self._db = PgerDb() - self.registry = PgerObjectRegistry(domains) - self._factory = PgerObjectFactory(self.registry) - self.credchkr = UserDbCredChecker(self._db) + self.infum = Infundibulum() + self.credchkr = UserDbCredChecker(self.infum) self.glimpseservers = {} # self.glimpseservers = {'Alert' : '25000'} if self.glimpseservers: for name in self.glimpseservers: gs = GlimpseServer(self.glimpseservers[name]) self.glimpseservers[name] = gs + if encrypted: + log.msg('PGER started (over SSL encryption)', system='PGER') + else: + log.msg('PGER started (no encryption)', system='PGER') - def changePassword(self, password, username, requestor): + def changePassword(self, requestor, userid, password): """ - Change a password for a username. + Change a password for a userid. @type password: string param password: new password - @type username: string - @param username: pgef_oid of the Person whose password + @type userid: string + @param userid: pgef_oid of the Person whose password is to be changed @type requestor: string @param requestor: pgef_oid of the Person who is requesting the change """ - if username: - if (username != requestor and requestor != 'admin'): + if userid: + if (userid != requestor and requestor != 'admin'): s = """Are you a god?""" - raise PermissionError, s + raise pgefexceptions.PermissionError, s else: - username = requestor - # vet password here + userid = requestor + # TODO: vet password here try: dtstamp = DateTime.now() dt = dtstamp.strftime("%Y-%m-%d %H:%M:%S") - self._db.updateRow('credential', - updates=[['password', sha.sha(password).hexdigest()], - ['pger_mod_datetime', dt], - ['pger_modifier_oid', requestor]], - where=[['owner_oid', '=', username], - ['system_oid', '=', 'PGER']]) - logmsg = 'Password changed for user %s' % username - log.msg(logmsg, system='%s:PGER' % requestor) - return 'OK' + d = self.infum.changePassword( + requestor, + userid=userid, + newpasswd=sha.sha(password).hexdigest()) + d.addCallbacks(lambda x: + self.cpSuccess(x, requestor, userid), + lambda x: + self.cpFailure(x, requestor, userid)) + return d except: - logmsg = "Unexpected error in changePassword: %s" % sys.exc_info()[0] + logmsg = "Error during changePassword: %s" % sys.exc_info()[0] log.msg(logmsg, system='%s:PGER' % requestor) raise + def cpSuccess(self, d, requestor, userid): + logmsg = 'Password changed for user %s (requestor: %s).' % ( + userid, requestor) + log.msg(logmsg, system='%s:PGER' % requestor) + return logmsg - def startService(self): - """Start services that should start up when PGER starts - (e.g., an organization service, a dictionary service, - etc.). - - TO DO: set up a ConfigParser so that the services may - have defaults set in vger.conf and startService can test - for them. - - [ startService is unnecessary right now -- it's just a - placeholder for setup procedures that should run at - startup time rather than when mktap is run. ] - """ - pb.Service.startService(self) - - - def getKnownClassNames(self): - return self.registry.pgef_classes.keys() - - def getResultSets(self, classname, requestor='anonymous', - refs=0, subtypes=0, **kw): - """ - (A wrapper interface through which any PgefObject - subclass can be requested.) - - @type classname: string - @param classname: the name of a PGEF ontoclass. This - can be either a subtype of - L{pangalactic.enterprise.pgefobject.PgefObject}) - or an ontoclass known to the PgefRegistry. - - @type requestor: string - @param requestor: the username of the user making the - request - - @type refs: integer - @param refs: specifies whether to include the objects - referenced by the specified class. - - 0: (default) do not get refs - 1: get all references - - (in future, refs may specify how many - reference levels to follow ...) - - @type subtypes: boolean - @param subtypes: specifies whether to include only the - specified class (the default) or all - subtypes. - - 0: (default) only this type - 1: include subtypes - - @param kw: keyword arguments of the form: - - key: an attribute of the object - value: the value to be selected by - - @rtype: list - @return: list of pyPgSQL result sets - """ - if classname not in self.registry.pgef_classes: - logmsg = 'getMappedObjects, %s, %s' % (classname, str(kw)) - log.msg(logmsg, system='%s:PGER' % requestor) - return self._getMappedObjects(classname, requestor, - subtypes, objects=0, **kw) - else: - logmsg = 'getResultSets, %s, %s' % (classname, str(kw)) - log.msg(logmsg, system='%s:PGER' % requestor) - return self._getResultSets(classname, requestor, refs, - subtypes, **kw) - + def cpFailure(self, e, requestor, userid): + logmsg = 'Password change for user %s failed (requestor: %s).' % ( + userid, requestor) + log.msg(logmsg, system='%s:PGER' % requestor) + return logmsg - def _getResultSets(self, classname, requestor='anonymous', - refs=0, subtypes=0, **kw): + def getObjects(self, requestor, ocid, refs=0, subtypes=0, + ret='extracts', **kw): """ - From the table corresponding to the specified type, get - all PGERDB rows that match the supplied kw parameters. - - usage: _getResultSets([object type name], refs, **kw) - - return a list of pyPgSQL ResultSet instances - - TO DO: role-based authorization checks based on - object type, etc. - - @type classname: string + An interface through which any set of PgefObject subclass instances + can be requested by attributes. The distinction between + getObjects() and search() is that getObjects() only finds exact + matches, and is therefore usually quicker if the exact values of + the attributes of the instances desired are known. @type requestor: string - @param requestor: the username of the user making the - request + @param requestor: the userid of the user making the request. - @type refs: boolean - @param refs: specifies whether to include the objects - referenced by the specified class. + @type ocid: string + @param ocid: the name of a PGEF OntoClass. This can be either a + subtype of L{pangalactic.enterprise.pgefobject.PgefObject}) or + an OntoClass known to the PanGalacticRegistry. - 0: (default) do not get refs - 1: get all references + @type refs: integer + @param refs: specifies whether to include the objects referenced + by the specified class. + + 0: (default) do not get refs + 1: get all references - (in future, refs may specify how many - reference levels to follow ...) + (in future, refs may specify how many reference levels to + follow ...) @type subtypes: boolean - @param subtypes: specifies whether to include only the - specified class (the default) or all - subtypes. + @param subtypes: specifies whether to include only the specified + class (the default) or all subtypes. - 0: (default) only this type - 1: include subtypes + 0: (default) only this type + 1: include subtypes - @param kw: keyword arguments of the form: + @type ret: str + @param ret: specifies in what form to return the results. - key: an attribute of the object - value: the value to be selected by + 'extracts': (default) extracts + 'objects': objects - @rtype: list - @return: list of pyPgSQL result sets - """ - table = self.registry.tableNameForClass(classname) - if kw: - # basic validity check on kw args ... - dbargs = [] - for a in kw.keys(): - if not a in self.registry.table_cols[table]: - raise ValueError, '%s is not in the schema of %s' % (a, classname) - dbargs.append((a, '=', kw[a])) - dres = self._db.doPgerdbQuery(table, subtypes, *dbargs) - dres.addErrback(log.err) - if not refs: - return dres - else: - dres.addCallback(self._getRefdRowKeys) - dres.addCallback(lambda x: - [self._db.getByRowKey(rk) - for rk in x]) - dres.addCallback(defer.gatherResults) - dres.addCallback(lambda x: [rsl[0] for rsl in x]) - dres.addCallback(utils.unique) - return dres - else: - d = defer.Deferred() - d.callback([]) - return d + @param kw: keyword arguments of the form: + key: an attribute of the object + value: the value to be selected by - def _getRefdRowKeys(self, rsets): + @rtype: list + @return: list of results (type of items depends on value of + 'ret' param). """ - Get all rowkeys of objects referenced by a list of - resultsets (including rowkeys of the objects represented - in the resultsets themselves). A rowkey is just a list: - [tablename, pgef_oid]. - """ - if rsets: - rowkeys = [] - for rs in rsets: - cname = rs['pgef_class'] - table = self.registry.tableNameForClass(cname) - klass = self.registry.pgef_classes[cname] - refs = klass._refs - fk = klass._fk - # include the rowkey for the current rset - rk = [table, rs['pgef_oid']] - rowkeys.append(rk) - if refs: - for a in refs: - table = self.registry.tableNameForClass(refs[a]) - rk = [table, rs[fk[a]]] - rowkeys.append(rk) - return rowkeys - else: - return [] + logmsg = 'getObjects, %s, %s' % (ocid, str(kw)) + log.msg(logmsg, system='%s:PGER' % requestor) + return self.infum.getObjects(requestor, ocid, refs, subtypes, + ret=ret, **kw) - def getObjects(self, classname, requestor='anonymous', - refs=1, subtypes=0, **kw): + def findObjects(self, requestor, ocid, refs=1, subtypes=0, + ret='extracts', fulltext='', args=None): """ - Get all PGEF objects of a specified type that match the - supplied kw parameters - - usage: getObjects([object type name], - [refs,] - [subtypes,] - **kw) - - get repository objects by attributes - - return a list of the objects - - TO DO: role-based authorization checks based on - object type, etc. - - @type classname: string - @param classname: the name of a PGEF class (i.e., a subtype of - L{pangalactic.enterprise.pgefobject.PgefObject}) + Search for all instances that match the specified arguments for the + specified type. - @type refs: integer - @param refs: specifies whether to include the objects - referenced by the specified class. - - 0: do not get references - - 1: get all references - (in future, refs may specify how many - reference levels to follow ...) + The attribute 'fulltext' is special -- it is only valid for types + with a _searchabletext attribute that evaluates to True, and will + cause the _searchFullText() function to be called and the results + of that function will be combined with the search results from + other attributes using the _getIntersectionResults() function. - @type subtypes: boolean - @param subtypes: specifies whether to include only the - specified class (the default) or all - subtypes. - - 0: only this type - - 1: include subtypes + @type ocid: string + @param ocid: id of the OntoClass of the instances to search for. - @param kw: keyword arguments of the form: - key: an attribute of the object - value: the value to be selected by - """ - # TODO: implement refs and subtypes ... - table = self.registry.tableNameForClass(classname) - tn = classname - if kw: - # basic validity check on kw args ... - dbargs = [] - for a in kw.keys(): - if not a in self.registry.table_cols[table]: - e = '%s is not in the schema of %s' % (a, tn) - raise ValueError, e - dbargs.append((a, '=', kw[a])) - logmsg = 'getObjects, %s, %s' % (classname, str(kw)) - log.msg(logmsg, system='%s:PGER' % requestor) - result = self._db.doPgerdbQuery(table, subtypes, *dbargs) - result.addErrback(log.err) - return result.addCallback(lambda res: - self._factory.makeObjects(tn, res)) - else: - raise ValueError, 'No criteria were supplied.' + @type refs: boolean + @param refs: specifies whether to include the objects referenced + by the specified class. + 0: (default) do not get refs + 1: get all references - def search(self, classname, requestor='anonymous', - refs=1, subtypes=0, objects=0, args=None): - """ - Search for all records from the table or view that - matches the specified arguments for the specified type. + (in future, refs may specify how many reference levels to + follow ...) - The attribute 'fulltext' is special -- it is only valid - for types with a _searchabletext attribute that evaluates - to True, and will cause the _searchFullText() function to - be called and the results of that function will be - combined with the search results from other attributes - using the _getIntersectionResults() function. - - @type classname: string - @param classname: the name of the class of objects to - search for (i.e., a subtype of - L{pangalactic.enterprise.pgefobject.PgefObject}) + @type subtypes: boolean + @param subtypes: specifies whether to include only the specified + class (the default) or all subtypes. - @type refs: boolean - @param refs: specifies whether to include the objects - referenced by the specified class. - 0: (default) do not get refs - 1: get all references - (in future, refs may specify how many - reference levels to follow ...) + 0: (default) only this type + 1: include subtypes - @type subtypes: boolean - @param subtypes: specifies whether to include only the - specified class (the default) or all - subtypes. - 0: (default) only this type - 1: include subtypes - - @type objects: boolean - @param objects: specifies whether to return objects - of the type specified or resultsets. - 0: resultsets - 1: objects - - @type args: sequence - @param args: a list of query element tuples, in which each - tuple has the form: - - element[0] = attribute name - - element[1] = logical operator - - element[2] = search value - ... where operator can be any SQL operator, - e.g.: 'LIKE', '=', '<', '>', etc. Note that - if the operator is 'LIKE' and the attribute - is a string, a case-independent search will - be done, treating the search value as a - substring. + @type ret: string ('object' or 'extract') + @param ret: specifies whether to return objects or extracts + (default: 'extracts'). + + @type args: list + @param args: a list of query element tuples, in which each tuple + has the form: + + - element[0] = attribute name + - element[1] = logical operator + - element[2] = search value + + ... where operator can be any SQL operator, e.g.: 'LIKE', '=', + '<', '>', etc. Note that if the operator is 'LIKE' and the + attribute is a string, a case-independent search will be done, + treating the search value as a substring. - @type kw: string or sequence - @param kw: (optional kw args) valid names are: + @type kw: string or sequence + @param kw: (optional kw args) valid names are: - B{orderby}: column(s) to be sorted on -- - this can be either a string (a single - column name) or a list or tuple of column - names - - @rtype: L{twisted.internet.defer.Deferred} - sequence of resultsets or sequence of - instances of subtypes of - L{pangalactic.enterprise.pgefobject.PgefObject} - @return: deferred result of search + B{orderby}: column(s) to be sorted on -- this can be either a + string (a single column name) or a list or tuple of column + names. + + @rtype: L{twisted.internet.defer.Deferred} sequence of resultsets + or sequence of instances of subtypes of + L{pangalactic.enterprise.pgefobject.PgefObject} + @return: deferred result of search """ - logmsg = 'search, %s, %s' % (classname, str(args[0])) + logmsg = 'search, %s, %s' % (ocid, str(args[0])) log.msg(logmsg, system='%s:PGER' % requestor) - table = self.registry.tableNameForClass(classname) - dbargs = [] - fulltext = 0 if args: - for a in args: - if not isinstance(a, (list, tuple)): - e = 'search args must be lists or tuples' - raise TypeError, e - elif a[0] == 'fulltext': - # do Glimpse search on fulltext string - dft = self._searchFulltext(classname, - requestor, a[1]) - fulltext = 1 - else: - # all other args go to db search - dbargs.append(a) - if dbargs: - # TODO: somewhere in here we need to pick the - # appropriate view to use for the search ... - # also should probably test dbargs and raise an - # exception if not well-formed. - dres = self._db.doPgerdbQuery(table, subtypes, *dbargs) - dres.addErrback(log.err) - if fulltext: - # need to fix _getIntersectionResultSets for this - # to work ... - dres = defer.gatherResults([dres, dft], fireOnOneErrback=1) - dres.addCallback(self._getIntersectionResultSets) - if not refs: - if objects: - return dres.addCallback(lambda x: - self._factory.makeObjects(classname, x)) - else: - return dres - else: - dres.addCallback(self._getRefdRowKeys) - dres.addCallback(lambda x: - [self._db.getByRowKey(rk) - for rk in x]) - dres.addCallback(defer.gatherResults) - dres.addCallback(utils.unique) - if objects: - return dres.addCallback(lambda x: - self._factory.makeObjects(classname, x)) - else: - return dres + return self.infum.findObjects(requestor=requestor, + ocid=ocid, + refs=refs, + subtypes=subtypes, + ret=ret, + args=args) else: raise ValueError('Need some arguments!') - def _searchFulltext(self, classname, requestor, - searchstring, **kw): - """ - Search for all documents of a given type containing - the specified string. Default returntype is a unique - document identifier string. - - @type classname: string - @param classname: the name of a PGER object type (i.e., a - subtype of - L{pangalactic.enterprise.pgefobject.PgefObject}) - - @type searchstring: string - @param searchstring: the string to be searched for - - @param kw: optional kw args. Currently, there are no - recognized kw args. - - @rtype: list of strings - @return: either basenames or paths, depending on I{returntype} - """ - gs = self._glimpseservers[classname] - return gs.search(searchstring) - - - def _getIntersectionResultSets(self, (resultsets, oids)): - # this needs to be updated! resultsets should contain a - # reference to the server-side file path (i.e., where's - # the vault?), so use that instead of the oid ... - intersectionsets = [] - for pgresultset in resultsets: - if pgresultset['pgef_oid'] in oids: - intersectionsets.append(pgresultset) - return intersectionsets - - - def addObjects(self, requestor='anonymous', olist=[]): + def addObjects(self, requestor, objects=None, input='extracts', + ret='extracts'): """ Add a list of PGEF objects to PGER + - usage: addObjects(list of PGER objects) - procedure: - create a list of extracts of the objects - call addExtracts - - NOTE: any application objects referenced as an - attribute of an object to be added must already - exist in PGER. - - TODO: role-based authorization checks based on - object type, etc. - - @type olist: a list of objects that are subtypes of - L{pangalactic.enterprise.pgefobject.PgefObject} - @param olist: a list of PGEF objects - """ - logmsg = 'addObjects, calling addExtracts' + - NOTE: any application objects referenced as an attribute of + an object to be added must already exist in PGER. + - TODO: role-based authorization checks + + @type input: string ('object' or 'extract') + @param input: the form of the submitted objects + + @type ret: string ('object' or 'extract') + @param ret: the form of the returned objects + + @type objects: list + @param objects: a list of instances of subtypes of + L{pangalactic.enterprise.pgefobject.PgefObject} to be added to + the repository + """ + if not objects: + raise ValueError('Need some objects!') + logmsg = 'addObjects, calling chronosynclastic ...' log.msg(logmsg, system='%s:PGER' % requestor) - extracts = [self._factory.extract(o) for o in olist] - return self.addExtracts(requestor, extracts) + return self.infum.addObjects(requestor, + objects, + input=input, + ret=ret) - def addExtracts(self, requestor='anonymous', extracts=None): - """ - Add a list of extracts of PGEF objects to PGERDB. - - Procedure: - - add a row to the appropriate PGERDB table for - each object - - check for the pger_create_datetime of each - referenced object recursively and add a row to - the appropriate PGERDB table for each object - that does not have a pger_create_datetime - - return a datetime stamp that is the - pger_create_datetime and pger_mod_datetime for - all the committed objects - - @type extracts: list - @param extracts: list of extracts of instances of subclasses of - L{pangalactic.enterprise.pgefobject.PgefObject} - - @rtype: list of deferreds - @return: list of deferred extracts of the PGEF objects - L{pangalactic.enterprise.pgefobject.PgefObject} - that were added - """ - if not extracts: - extracts = [] - # TODO: role-based authorization checks based on object - # type, requestor, permissions, etc. - dtstamp = DateTime.now() - dt = dtstamp.strftime("%Y-%m-%d %H:%M:%S") - data = {} - data['pger_create_datetime'] = dt - data['pger_mod_datetime'] = dt - data['pger_owner_oid'] = requestor - data['pger_creator_oid'] = requestor - data['pger_modifier_oid'] = requestor - objs = {} - for e in extracts: - # set 'pger_*' attributes for each object - e.update(data) - # get tally of classes for log message - if objs.has_key(e['pgef_class']): - objs[e['pgef_class']] += 1 - else: - objs[e['pgef_class']] = 1 - logmsg = 'addExtracts, %s' % (str(objs)) - log.msg(logmsg, system='%s:PGER' % requestor) - recs = [self._factory.extract2Record(e) - for e in extracts] - d = self._db.addRows(recs) - d.addCallback(lambda x: self._verifyAddExtracts(recs)) - d.addCallback(lambda x: - [self._factory.resultset2Extract(rs) - for rs in x]) - d.addErrback(self._addExtractsError) - return d - - - def _verifyAddExtracts(self, recs): - """ - Verify that a list of records have been added to PGERDB - by doing a query on their rowkeys. - - @type recs: list - @param recs: a list of records, which look like: - [tablename, {colname : value, ...}] - - @rtype: list - @return: list of resultsets, one for each record added - """ - d = defer.gatherResults( - [self._db.getByRowKey( - self._factory.record2RowKey(rec)) - for rec in recs]) - return d.addCallback(lambda rsl: [r[0] for r in rsl]) - # Note: the last step is needed because the gathered - # result is a list of lists of lists, and we really just - # want a list of lists (the r[0] works because there will - # only be one resultset returned for each RowKey). - - - def _addExtractsError(self, error): - """ - Callback for error in addExtracts. - - @type error: a deferred error - @param error: the error propagated by failure of a deferred - """ - log.msg("%s addExtracts failed: %s" % (reflect.qual(self.__class__), error), - system='PGER') - log.err(error) - - - def addVersions(self, requestor='anonymous', olist=[]): + def addVersions(self, requestor='anonymous', objects=None, + input='extracts'): """ Add a list of new versions of VersionedObjects to PGER + - usage: addVersions(list of VersionedObjects) - - procedure: - - call addVersion for each object - - return the result (a list of deferreds) - TODO: if any operation fails, back out the transaction - return extracts for all the committed objects - - NOTE: any application objects referenced as an - attribute of) an object to be added must already - exist in PGER. - - TODO: role-based authorization checks based on - object type, etc. + - NOTE: any application objects referenced as an attribute of) + an object to be added must already exist in PGER. + - TODO: role-based authorization checks @type requestor: string @param requestor: the pgef_oid (userid) of the user - attempting to execute the operation + attempting to execute the operation + + @type objects: a list of objects that are subtypes of + L{pangalactic.enterprise.versionedobject.VersionedObject} + @param objects: a list of VersionedObjects to be committed - @type olist: a list of objects that are subtypes of - L{pangalactic.enterprise.versionedobject.VersionedObject} - @param olist: a list of VersionedObjects to be - committed + @type input: string ('object' or 'extract') + @param input: the form of the submitted objects @rtype: a list of deferreds @return: a list of deferred VersionedObjects that were committed """ - logmsg = 'addVersions (%s objects)' % len(olist) + if not objects: + raise TypeError, 'objects not provided!' + logmsg = 'addVersions (%s objects)' % len(objects) log.msg(logmsg, system='%s:PGER' % requestor) - extracts = [self._factory.extract(o) for o in olist] - return self.addVersionExtracts(requestor, extracts) - - - def addVersion(self, requestor='anonymous', obj=None): - """ - Add a new version of a VersionedObject to PGER - - usage: addVersion(requestor, VersionedObject instance) - - procedure: - - create an extract of the object - - call addVersionExtract - - NOTE: any application objects referenced as an - attribute of) an object to be added must already - exist in PGER. - - TODO: role-based authorization checks based on - object type, etc. - - @type requestor: string - @param requestor: the pgef_oid (userid) of the user - attempting to execute the operation - - @type olist: a list of objects that are subtypes of - L{pangalactic.enterprise.versionedobject.VersionedObject} - @param olist: a list of VersionedObjects to be - committed - """ - logmsg = 'addVersion [%s]' % obj.pgef_class - log.msg(logmsg, system='%s:PGER' % requestor) - extract = self._factory.extract(obj) - return self.addVersionExtract(requestor, extract) - - - def addVersionExtracts(self, requestor='anonymous', extracts=None): - """ - Add a new version of a VersionedObject to PGER - - usage: addVersionExtracts(requestor, VersionedObject extracts) - - call addVersionExtract for each extract - - TODO: if any operation fails, back out the transaction - - NOTE: any application objects referenced as an - attribute of) an object to be added must already - exist in PGER. - - TODO: role-based authorization checks based on - object type, etc. - - @type requestor: string - @param requestor: the pgef_oid (userid) of the user - attempting to execute the operation - - @type extracts: list - @param extracts: a list of extracts of VersionedObject - instances - """ - logmsg = 'addVersionExtracts (%s extracts)' % len(extracts) - log.msg(logmsg, system='%s:PGER' % requestor) - res = [self.addVersionExtract(requestor, e) + if input == 'objects': + extracts = [self._factory.extract(o) for o in objects] + else: + extracts = objects + res = [self._addVersionExtract(requestor, extracts) for e in extracts] return defer.gatherResults(res) - def addVersionExtract(self, requestor='anonymous', e=None): + def addVersionExtract(self, requestor, e): """ Add an extract of a VersionedObject to PGER - usage: addVersionExtract(requestor, VersionedObject extract) - procedure: - - get the iteration of the current head - (head_flag=True) for that base_id - - set the iteration of the extract to the - incremented iteration of the current head - - call PgerDb.addRow - - set the head_flag to False for all versions - currently in the repository for that base_id + - get the iteration of the current head (head_flag=True) for + that base_id + - set the iteration of the extract to the incremented + iteration of the current head + - call PgerDb.addObjects + - set the head_flag to False for all versions currently in + the repository for that base_id - return an extract - - NOTE: any application objects referenced as an - attribute of) an object to be added must already - exist in PGER. - - TODO: role-based authorization checks based on - object type, etc. + - NOTE: any application objects referenced as an attribute of) + an object to be added must already exist in PGER. + - TODO: role-based authorization checks - @type requestor: string - @param requestor: the pgef_oid (userid) of the user - attempting to execute the operation + @type requestor: string + @param requestor: the pgef_oid (userid) of the user attempting to + execute the operation - @type e: dictionary - @param e: an extract of a VersionedObject instance + @type e: dictionary + @param e: an extract of a VersionedObject instance """ - logmsg = 'addVersionExtract for a %s' % e['pgef_class'] + ocid = e['onto_class'] + logmsg = 'addVersionExtract for a %s' % ocid log.msg(logmsg, system='%s:PGER' % requestor) - table = self.registry.tableNameForClass(e['pgef_class']) - res = self._db.doPgerdbQuery(table, 0, - [ - ['base_id', e['base_id'], '='], - ['head_flag', True, '='] - ]) + res = self.infum.getObjects(ocid, + base_id=e['base_id'], + head_flag=True) res.addCallbacks(lambda x: x[0].iteration, self.addVersionExtractError) # res.addCallbacks(, @@ -734,27 +356,27 @@ # self.addVersionExtractError) - def _setHeadFlags(self, extracts): + def _setHeadFlags(self, requestor, extracts): """ - For a list of extracts of newly-added VersionedObjects, - set the head_flag's of all other versions with the same - base_id to False. - - usage: _setHeadFlags(list of VersionedObject extracts) + For a list of extracts of newly-added VersionedObjects, set the + head_flag's of all other versions with the same base_id to False. - @type requestor: string - @param requestor: the pgef_oid (userid) of the user - attempting to execute the operation + - usage: _setHeadFlags(list of VersionedObject extracts) - @type olist: a list of objects that are subtypes of - L{pangalactic.enterprise.versionedobject.VersionedObject} - @param olist: a list of VersionedObjects to be - committed + @type requestor: string + @param requestor: the pgef_oid (userid) of the user attempting to + execute the operation + + @type olist: a list of objects that are subtypes of + L{pangalactic.enterprise.versionedobject.VersionedObject} + @param olist: a list of VersionedObjects to be committed """ for e in extracts: - table = self.registry.getTableForClass(e['pgef_class']) - d = self._db.updateRow(table, - updates={'head_flag': False}, - where=[['base_id', '=', e['base_id']], + d = self.infum.updateObjects( + requestor, + e['onto_class'], + updates={'head_flag': False}, + where=[['base_id', '=', e['base_id']], ['pgef_oid', '!=', e['pgef_oid']]]) return extracts @@ -771,9 +393,9 @@ log.err(error) - def addFile(self, requestor='', rheaders=None, content=None): + def addFile(self, requestor, rheaders=None, content=None): """ - Add a file PGER + Add a file to PGER - usage: addFiles(requestor, rheaders, content) - if an oid is provided and a corresponding record exists in the PGERDB 'pgef_file' table, update it @@ -813,7 +435,7 @@ try: updates = {} updates['pgef_oid'] = rheaders['oid'] - updates['mime_type_oid'] = rheaders['filemimetype'] + updates['mime_type'] = rheaders['filemimetype'] # TODO: should test user file name to make sure it # doesn't have any funky characters (e.g. spaces!) in # it ... @@ -821,7 +443,7 @@ dtstamp = DateTime.now() dt = dtstamp.strftime("%Y-%m-%d %H:%M:%S") updates['pger_mod_datetime'] = dt - updates['pger_modifier_oid'] = requestor + updates['pger_modifier'] = requestor updates['secured_flag'] = True updates['bytes'] = len(content) vaultpath = os.path.join(os.environ['PGERHOME'], 'vault') @@ -833,45 +455,54 @@ if not os.path.isdir(vpath): os.makedirs(vpath) roid = rheaders['oid'] - updates['location'] = os.path.join(vpath, roid) - # TODO: deferred processing begins here ... + updates['location'] = 'pger:vault' + location = os.path.join(vpath, roid) # print 'updates:' # pprint(updates) - def rowAction(res): - # print 'getByRowKey result:' + def addOrUpdate(r): + # print 'pre-existing PgefFile:' # pprint(res) - if len(res): + if len(r): # print 'updating row ...' - d = self._db.updateRow('pgef_file', updates=updates, - where=[['pgef_oid', '=', updates['pgef_oid']]]) + d = self.infum.updateObjects(requestor, + 'PgefFile', + oids=[updates['pgef_oid']], + updates=updates) else: # print 'adding row ...' - d = self._db.addRow('pgef_file', **updates) - d.addCallback(defer.succeed) - d.addErrback(self._addFileError) - row = self._db.getByRowKey(['pgef_file', roid]) - row.addCallback(rowAction) + updates['onto_class'] = 'PgefFile' + # print 'updates:' + # pprint(updates) + d = self.infum.addObjects(requestor, + [updates]) + # d.addCallback(defer.succeed) + return d.addErrback(self._addFileError) + # deferred chain begins here ... + res = self.infum.getObjects(requestor, 'PgefFile', pgef_oid=roid) + res.addCallback(addOrUpdate) logmsg = 'addFile adding file %s as %s' % ( updates['user_file_name'], updates['pgef_oid']) log.msg(logmsg, system='%s:PGER' % requestor) - self._vaultFile(requestor, content, updates['location']) - output = str(updates['bytes']) - output += ' ' + updates['pgef_oid'] - return output + res.addCallback(lambda x: + self._vaultFile(requestor, + content, + location, + x)) + return res except: logmsg = "Error in addFile: %s" % sys.exc_info()[0] log.msg(logmsg, system='%s:PGER' % requestor) raise - def _vaultFile(self, requestor, content, filepath): + def _vaultFile(self, requestor, content, filepath, d): fp = open(filepath, 'w') fp.write(content) fp.close() logmsg = '%s bytes written' % len(content) log.msg(logmsg, system='%s:PGER' % requestor) - return 'OK' + return d def _addFileError(self, error): """ From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:29:46 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:29:46 2004 Subject: [Pangalactic-commits] Revised pgertap.py Message-ID: <200408090229.i792TkZZ017933@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/pgertap.py 1.28 1.29 Log message: Revised pgertap.py Index: PanGalactic/pangalactic/pgertap.py diff -u PanGalactic/pangalactic/pgertap.py:1.28 PanGalactic/pangalactic/pgertap.py:1.29 --- PanGalactic/pangalactic/pgertap.py:1.28 Thu May 20 00:19:54 2004 +++ PanGalactic/pangalactic/pgertap.py Sun Aug 8 22:29:44 2004 @@ -1,9 +1,9 @@ """ Twisted Tap-builder for the Pan Galactic Repository Service -@version: $Revision: 1.28 $ +@version: $Revision: 1.29 $ """ -__version__ = "$Revision: 1.28 $"[11:-2] +__version__ = "$Revision: 1.29 $"[11:-2] # $Source: /repo/step_testbed/PanGalactic/pangalactic/pgertap.py,v $ # Twisted imports ... @@ -13,6 +13,7 @@ from twisted.enterprise import adbapi from twisted.internet import ssl from twisted.python import usage +from twisted.python import log from twisted.spread import pb from twisted.web import script from twisted import web @@ -31,13 +32,9 @@ ["encrypted", "e", "0", "Specifies whether to use SSL."], ["pbport", "b", str(pb.portno)], - ["datafilepath", "f", "/usr/local/data", - """Root directory for "secured files" -- - i.e., servable files which are completely - controlled and managed by the repository. - This root should not be a statically - Web-accessible directory, although some of - its subdirectories might possibly be."""], + ["home", "h", "/usr/local/pger", + """Home directory for PGER. This can also be set + using the environment variable PGERHOME."""], ["domains", "d", "", """List of domains."""]] @@ -52,8 +49,8 @@ if config["pbport"]: pbport = int(config["pbport"]) - if config["datafilepath"]: - datafilepath = config["datafilepath"] + if config["home"]: + home = config["home"] if config["domains"]: # configure domains domains = config["domains"] @@ -62,7 +59,7 @@ app = Application('PanGalaxian') # TODO: make this more elegantly configured - pgerhub = Pger(domains=domains) + pgerhub = Pger(domains=domains, encrypted=encrypted) pgerhub.setServiceParent(app) pgerchkr = pgerhub.credchkr @@ -119,8 +116,9 @@ site = web.server.Site(mux) if encrypted: - ctx = ssl.DefaultOpenSSLContextFactory('ssl/privkey.pem', - 'ssl/cert.pem') + privkey = '/'.join([home, 'ssl/privkey.pem']) + certifc = '/'.join([home, 'ssl/cert.pem']) + ctx = ssl.DefaultOpenSSLContextFactory(privkey, certifc) webserv = internet.SSLServer(webport, site, ctx) else: webserv = internet.TCPServer(webport, site) From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:31:28 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:31:29 2004 Subject: [Pangalactic-commits] Mods to PanGalactic class roster in __init__.py Message-ID: <200408090231.i792VSua017968@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/__init__.py 1.2 1.3 Log message: Mods to PanGalactic class roster in __init__.py Index: PanGalactic/pangalactic/__init__.py diff -u PanGalactic/pangalactic/__init__.py:1.2 PanGalactic/pangalactic/__init__.py:1.3 --- PanGalactic/pangalactic/__init__.py:1.2 Thu May 20 00:19:54 2004 +++ PanGalactic/pangalactic/__init__.py Sun Aug 8 22:31:27 2004 @@ -2,22 +2,20 @@ PanGalactic """ -Classes = [ - 'Acu', +Classes = ['Acu', 'Dcu', - 'DocPtRel', 'Document', + 'Mime', 'Model', - 'OntoClass', - 'OntoProperty', 'Organization', 'Part', 'PartsList', 'Person', + 'PersonRole', 'PgefFile', 'PgefObject', + 'PgefRepresentation', + 'PgefRole', 'Project', - 'Role', - 'VersionedObject' - ] + 'VersionedObject'] From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:37:28 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:37:30 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/pangalactic/importers added to the repository Message-ID: <200408090237.i792bS7X018003@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/importers Log message: Directory /repo/step_testbed/PanGalactic/pangalactic/importers added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:38:51 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:38:52 2004 Subject: [Pangalactic-commits] Add (non-functional :) OWL reader. Message-ID: <200408090238.i792cpwA018042@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/importers/__init__.py None 1.1 PanGalactic/pangalactic/importers/owlreader.py None 1.1 Log message: Add (non-functional :) OWL reader. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:53:48 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:53:50 2004 Subject: [Pangalactic-commits] Beginnings of fixes to client modules ... some breakage! Message-ID: <200408090253.i792rm6Y018146@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.105 1.106 PanGalactic/pangalactic/client/modules/dm/ms2alert.py 1.3 1.4 PanGalactic/pangalactic/client/modules/psm/docform.py 1.3 1.4 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.34 1.35 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py 1.39 1.40 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.141 1.142 PanGalactic/pangalactic/client/modules/psm/itemsearchform.py 1.25 1.26 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.8 1.9 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.23 1.24 PanGalactic/pangalactic/client/modules/psm/partform.py 1.8 1.9 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.32 1.33 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.32 1.33 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py 1.43 1.44 PanGalactic/pangalactic/client/modules/psm/pgeftree.py 1.38 1.39 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py 1.19 1.20 PanGalactic/pangalactic/client/modules/psm/propertiesform.py 1.15 1.16 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.168 1.169 PanGalactic/pangalactic/client/modules/psm/searchframe.py 1.39 1.40 PanGalactic/pangalactic/client/tests/test_itemeditframe.py 1.17 1.18 PanGalactic/pangalactic/client/tests/test_person.py 1.9 1.10 PanGalactic/pangalactic/client/tests/test_pgefobject.py 1.12 1.13 PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py 1.11 1.12 Log message: Beginnings of fixes to client modules ... some breakage! TODO: 1. Implement lazy eval of 'object[-valued] properties' 2. Fix NARS so that it is not mentioned in any PanGalactic modules (this is doable, but I probably won't get it done tonite!) 3. Better implementation of default display names, etc. 4. More fixage Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.32 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.33 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.32 Fri Jun 4 16:20:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Sun Aug 8 22:53:45 2004 @@ -90,7 +90,7 @@ def fillForm(self, PartsListObject, showfilename = True): #print "partslistform.fillform" - self.GetTextctrlPoc().SetValue(PartsListObject.owner_oid) + self.GetTextctrlPoc().SetValue(PartsListObject.owner) self.GetTextctrlListversion().SetValue(PartsListObject.revision) ctrl = self.GetChoiceType() ctrl.SetSelection(ctrl.FindString(PartsListObject.Type)) @@ -101,7 +101,7 @@ def fillObject(self, PartsListObject): #print "partslistform.fillobject" - PartsListObject.owner_oid = self.GetTextctrlPoc().GetValue() + PartsListObject.owner = self.GetTextctrlPoc().GetValue() PartsListObject.revision = self.GetTextctrlListversion().GetValue() PartsListObject.Type = self.GetChoiceType().GetStringSelection() PartsListObject.id = self.GetTextctrlPartslistid().GetValue() Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.3 PanGalactic/pangalactic/client/modules/psm/docform.py:1.4 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.3 Fri Jun 4 16:20:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Sun Aug 8 22:53:45 2004 @@ -238,7 +238,7 @@ def fillForm(self, Doc, docversion = None): #print "docform.fillform" - self.GetAuthorWgt().SetValue(Doc.creator_oid) + self.GetAuthorWgt().SetValue(Doc.creator) self.GetIdentifierWgt().SetValue(Doc.id) self.GetTitleWgt().SetValue(Doc.name) self.GetTypeWgt().SetValue(Doc.doc_type_oid) @@ -248,7 +248,7 @@ def fillObject(self, Doc): #, docversion = None): #print "docform.fillobject" - Doc.creator_oid = self.GetAuthorWgt().GetValue() + Doc.creator = self.GetAuthorWgt().GetValue() Doc.id = self.GetIdentifierWgt().GetValue() Doc.base_id = Doc.id Doc.name = self.GetTitleWgt().GetValue() Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.8 PanGalactic/pangalactic/client/modules/psm/partform.py:1.9 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.8 Tue Mar 23 14:32:19 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Sun Aug 8 22:53:45 2004 @@ -164,18 +164,18 @@ return self.GetIdentifier().SetValue(partobj.id) self.GetName().SetValue(partobj.name) - self.GetPoc().SetValue(partobj.creator_oid) - self.GetNomenclature().SetValue(partobj.short_description) - self.GetDesc().SetValue(partobj.long_description) + self.GetPoc().SetValue(partobj.creator) + self.GetNomenclature().SetValue(partobj.description) + self.GetDesc().SetValue(partobj.comment) self.temp_part = partobj def fillObject(self, partobj): partobj.id = self.GetIdentifier().GetValue() partobj.name = self.GetName().GetValue() - partobj.creator_oid = self.GetPoc().GetValue() - partobj.short_description = self.GetNomenclature().GetValue() - partobj.long_description = self.GetDesc().GetValue() + partobj.creator = self.GetPoc().GetValue() + partobj.description = self.GetNomenclature().GetValue() + partobj.comment = self.GetDesc().GetValue() return partobj def clearForm(self): Index: PanGalactic/pangalactic/client/tests/test_pgefobject.py diff -u PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.12 PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.13 --- PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.12 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/client/tests/test_pgefobject.py Sun Aug 8 22:53:46 2004 @@ -25,20 +25,20 @@ assert self.obj1.creator == '', 'Incorrect initial value for Creator' def testIsEqual(self): - """Check to see that the IsEqual method functions properly""" + """Check to see that the isEqual method functions properly""" self.obj1.popTestData() self.obj2.popTestData() - assert self.obj1.IsEqual(self.obj2), 'Object1 and object2 are not equal' + assert self.obj1.isEqual(self.obj2), 'Object1 and object2 are not equal' def testIsEmpty(self): - """Check to see that the IsEmpty returns true when the object is empty""" - result = self.obj1.IsEmpty() + """Check to see that the isEmpty returns true when the object is empty""" + result = self.obj1.isEmpty() assert result == True , 'New object should have been empty' def testIsNotEmpty(self): - """Check to see that the IsEmpty returns false when the object is empty""" + """Check to see that the isEmpty returns false when the object is empty""" self.obj1.creator = '123' - result = self.obj1.IsEmpty() + result = self.obj1.isEmpty() assert result == False , 'Object should not have been empty' self.obj1.creator = '' @@ -58,7 +58,7 @@ self.obj2 = pgefobject.PgefObject() self.obj1.popTestData() self.obj2.build(self.obj1.__dict__) - assert self.obj1.IsEqual(self.obj2), 'Object1 and object2 are not equal' + assert self.obj1.isEqual(self.obj2), 'Object1 and object2 are not equal' def suite(): Index: PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py diff -u PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py:1.11 PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py:1.12 --- PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py:1.11 Sun Mar 7 01:52:41 2004 +++ PanGalactic/pangalactic/client/tests/test_xmlrpcinterface.py Sun Aug 8 22:53:46 2004 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpcinterface.py,v 1.11 2004/03/07 06:52:41 waterbug Exp $ +# $Id: test_xmlrpcinterface.py,v 1.12 2004/08/09 02:53:46 waterbug Exp $ """ Functional test for pangalactic.util.xmlrpcinterface @@ -12,6 +12,6 @@ xcli = XmlrpcInterface('beeblebrox.gsfc.nasa.gov', '8080') print "xcli", xcli -res = xcli.getObjects("Part", {'project_oid' : 'H2G2'}, 1, 0, []) +res = xcli.getObjects("Part", {'project' : 'H2G2'}, 1, 0, []) print res Index: PanGalactic/pangalactic/client/modules/psm/pgeftree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.38 PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.39 --- PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.38 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgeftree.py Sun Aug 8 22:53:45 2004 @@ -15,7 +15,7 @@ import pangalactic.client.modules.psm.itemdroptarget as itemdroptarget import pangalactic.client.io.treereport as treereport -__version__ = "$Revision: 1.38 $"[11:-2] +__version__ = "$Revision: 1.39 $"[11:-2] class PgefTree(wxTreeCtrl): @@ -122,7 +122,7 @@ dropSource.DoDragDrop(True) - def LoadTreefromObjects(self, dm, rootobj, parentnode = None): #AssemblyID, rootnode = None, currentdata = None): + def LoadTreefromObjects(self, dm, rootobj, parentnode=None): #AssemblyID, rootnode = None, currentdata = None): """Loads the tree from the dicts in the DataManager""" #print "pgeftree.loadtreefromobjects" @@ -146,12 +146,12 @@ localacus = dm.getLocalAcus(dm.CurrentProject) for acuid, acuobj in localacus.items(): - if acuobj._assembly.pgef_oid == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: + if acuobj.assembly == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: AcuIds.append(acuid) for acuid in AcuIds: acuobj = dm.getLookupObject(acuid) - itemobj = acuobj._component + itemobj = dm.getLookupObject(acuobj.component) if itemobj and acuobj.state <> objectstatus.DELETE: treeid = self.AppendItem(rootnode, itemobj.id) Index: PanGalactic/pangalactic/client/modules/psm/propertiesform.py diff -u PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.15 PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.16 --- PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.15 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/propertiesform.py Sun Aug 8 22:53:45 2004 @@ -78,12 +78,12 @@ if retval == "Download Failed": # print "download failed; faking it" -# self.GetFakeData(component.short_description) +# self.GetFakeData(component.description) dlg.Destroy() return except: #print "error: download failed; faking it" -# self.GetFakeData(component.short_description) +# self.GetFakeData(component.description) dlg.Destroy() return Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.105 PanGalactic/pangalactic/client/fnord.py:1.106 --- PanGalactic/pangalactic/client/fnord.py:1.105 Thu Jul 15 15:14:49 2004 +++ PanGalactic/pangalactic/client/fnord.py Sun Aug 8 22:53:44 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.105 2004/07/15 19:14:49 pbear Exp $ +# $Id: fnord.py,v 1.106 2004/08/09 02:53:44 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.105 $ +@version: $Revision: 1.106 $ """ -__version__ = "$Revision: 1.105 $"[11:-2] +__version__ = "$Revision: 1.106 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -605,7 +605,7 @@ still_trying = False dlg.Destroy() - elif self.dm.user.god_flag: + elif self.dm.user.god: dlg = ChangePasswd(self, -1, "Change Admin Password") dlg.CentreOnParent() still_trying = True @@ -845,7 +845,7 @@ dlg.ShowModal() def addSpecialMenus(self, user_info): - if self.dm.user.god_flag: + if self.dm.user.god: self.AddGodMenu(self.dm.user) elif self.dm.user.id == "admin": #admin_flag: self.AddAdminMenu(self.dm.user) @@ -853,7 +853,7 @@ def removeSpecialMenus(self, user_info): if self.AdminMenu: #userinfo.id == "admin" and self.AdminMenu: #admin_flag and self.AdminMenu: self.RemoveAdminMenu(user_info) - elif self.GodMenu: #userinfo.god_flag and self.GodMenu: + elif self.GodMenu: #userinfo.god and self.GodMenu: self.RemoveGodMenu() def RemoveAdminMenu(self, user_info): Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.34 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.35 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.34 Fri Jul 9 14:08:59 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Sun Aug 8 22:53:45 2004 @@ -17,7 +17,7 @@ import pangalactic.utils.objectstatus as objectstatus import pangalactic.utils.preferences as preferences -__version__ = "$Revision: 1.34 $"[11:-2] +__version__ = "$Revision: 1.35 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -100,7 +100,7 @@ return # dfile = self.dm.newObject("PgefFile") -# dfile.parent_oid = newdoc.pgef_oid +# dfile.parent = newdoc.pgef_oid # dfile.setLocalFilename(newdoc._upload_file_name) # dfile.mime_type_oid = "text/plain" dfile = self.dm.newPgefFile(newdoc) #, newdoc._upload_file_name) @@ -208,7 +208,7 @@ if self.creatingDocument: tmp = self.dm.newObject("Document") self.docform.fillObject(tmp) - if tmp.IsEqual(self.currentdocument): + if tmp.isEqual(self.currentdocument): print "documenttreeframe.changesmade:no net changes" else: retval = True @@ -233,7 +233,7 @@ doc.state = objectstatus.ADD dfile = self.dm.newPgefFile(doc)#, doc._upload_file_name) -# dfile.parent_oid = doc.pgef_oid +# dfile.parent = doc.pgef_oid # dfile.setLocalFilename(doc._upload_file_name) # dfile.mime_type_oid = "text/plain" dfile.state = objectstatus.ADD Index: PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py diff -u PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.39 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.39 Fri Jun 18 15:28:11 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py Sun Aug 8 22:53:45 2004 @@ -11,7 +11,7 @@ from wxPython.wx import wxPoint, wxTreeItemIcon_Selected -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] #constants @@ -172,9 +172,9 @@ # create new nauo #print "create new nauo" newnauo = acu.Acu(subtype = 'nauo') - newnauo._component = dropitem + newnauo.component = dropitem newnauo.state = objectstatus.ADD - newnauo.InitObject(self.dm.CurrentProject, self.dm.user.id) + newnauo.initObject(self.dm.CurrentProject, self.dm.user.id) if haverootnode: #print "haverootnode; assembly is TOPLEVEL" @@ -182,12 +182,12 @@ tlobj = pmv.ProductModelVersion(_project = self.dm.CurrentProject) tlobj = model.Model(_project = self.dm.CurrentProject) #tlobj.pgef_oid = "TOPLEVEL" ## wtf???? vwk - newnauo._assembly = tlobj + newnauo.assembly = tlobj else: #print "havenode; assembly is oid" - newnauo._assembly = targetitem + newnauo.assembly = targetitem - #print "newnauo", newnauo.id, newnauo._assembly.id, newnauo._component.id + #print "newnauo", newnauo.id, newnauo.assembly.id, newnauo.component.id # add new nauo to localdb self.dm.addAcu(newnauo, targetnauo) try: Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.168 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.169 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.168 Fri Jul 9 14:08:59 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Sun Aug 8 22:53:45 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.168 $"[11:-2] +__version__ = "$Revision: 1.169 $"[11:-2] import os @@ -31,9 +31,9 @@ except ImportError: print "Sorry. PyCrust not available." -from pangalactic.enterprise.person import Person -from pangalactic.enterprise.role import Role -from pangalactic.enterprise.pgefobject import PgefObject +from pangalactic.enterprise.person import Person +from pangalactic.enterprise.pgefrole import PgefRole +from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.utils import datamanager #from pangalactic.utils import dbbrowser @@ -303,8 +303,8 @@ if row: self.modelgrid.SelectRow(row) - if obj._of_part: - row, tmp = self.itemgrid.getObjectByOid(obj._of_part.pgef_oid) + if obj.of_part: + row, tmp = self.itemgrid.getObjectByOid(obj.of_part) if row: self.itemgrid.SelectRow(row) @@ -1095,14 +1095,14 @@ ## tmp_role.RoleCode = 'GDA' ## tmp_role.Userid = 'pbear' ## tmp_role.id = "pbear" -## tmp_role.project_oid = 'H2G2' +## tmp_role.project = 'H2G2' ## tmp_roles.append(tmp_role) ## tmp_role = Role() ## tmp_role.RoleCode = 'GDA' ## tmp_role.Userid = 'test' ## tmp_role.id = "test" -## tmp_role.project_oid = 'H2G2' +## tmp_role.project = 'H2G2' ## tmp_roles.append(tmp_role) ## self.dm.saveRoles(tmp_roles) Index: PanGalactic/pangalactic/client/modules/psm/itemsearchform.py diff -u PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.25 PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.26 --- PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.25 Thu Jun 10 15:04:59 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemsearchform.py Sun Aug 8 22:53:45 2004 @@ -179,8 +179,8 @@ fieldlist = [] # the list of fields to check: (classname, attrname, value [, oper]) - fields.append(("all", "owner_oid", self.GetPOCWgt().GetValue())) - fields.append(("all", "creator_oid", self.GetAuthorWgt().GetValue())) + fields.append(("all", "owner", self.GetPOCWgt().GetValue())) + fields.append(("all", "creator", self.GetAuthorWgt().GetValue())) fields.append(("Part", "id", self.GetPartNameWgt().GetValue())) fields.append(("Part", "name", self.GetPartDescWgt().GetValue())) fields.append(("Model", "id", self.GetModelNameWgt().GetValue())) @@ -200,7 +200,7 @@ field = self.GetProjectWgt().GetValue() if field <> None and len(field.strip()) > 0 and field <> "Any": id_context = field.split(" (") - fieldlist.append(("all", "project_oid", default_op, id_context[0])) + fieldlist.append(("all", "project", default_op, id_context[0])) # set the criteria by class if len(fieldlist) > 0: Index: PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.19 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.20 --- PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.19 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py Sun Aug 8 22:53:45 2004 @@ -135,7 +135,7 @@ tmp_part = rootproduct elif classname == "Model": tmp_model = rootproduct - tmp_part = tmp_model._of_part + tmp_part = datamanager.getLookupObject(tmp_model.of_part) else: print "invalid object:", classname Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.32 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.33 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.32 Tue Jun 15 00:05:54 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Sun Aug 8 22:53:45 2004 @@ -25,7 +25,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.32 $"[11:-2] +__version__ = "$Revision: 1.33 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -138,7 +138,7 @@ if self.EditMode: # print "editpl" self.EditMode = False - partslist.UpdateObject(self.dm.user.id) + partslist.updateObject(self.dm.user.id) node = self.tree.GetSelection() data = self.tree.GetPyData(node) oldpl = self.dm.getLookupObject(data[1]) @@ -148,7 +148,7 @@ self.dm.refresh = True self.buildTree() else: - partslist.InitObject(self.State.currentprojectname, self.dm.user.id) + partslist.initObject(self.State.currentprojectname, self.dm.user.id) self.currentdocument.build(partslist.__dict__) # foobar - SOAP can't handle compound subobjects - pull 'em out and put 'em elsewhere @@ -320,7 +320,7 @@ if self.creatingDocument: tmp = self.dm.newObject("PartsList") self.docform.fillObject(tmp) - if tmp.IsEqual(self.currentdocument): + if tmp.isEqual(self.currentdocument): print "no net changes" else: retval = True Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.23 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.24 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.23 Wed Mar 17 16:21:22 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Sun Aug 8 22:53:45 2004 @@ -236,7 +236,7 @@ def FillForm(self, Doc, docversion = None): #print "otherdocform.fillform" - self.GetAuthorWgt().SetValue(Doc.creator_oid) + self.GetAuthorWgt().SetValue(Doc.creator) self.GetIdentifierWgt().SetValue(Doc.id) self.GetTitleWgt().SetValue(Doc.name) self.GetTypeWgt().SetValue(Doc.doc_type_oid) @@ -246,7 +246,7 @@ def FillObject(self, Doc): #, docversion = None): #print "otherdocform.fillobject" - Doc.creator_oid = self.GetAuthorWgt().GetValue() + Doc.creator = self.GetAuthorWgt().GetValue() Doc.id = self.GetIdentifierWgt().GetValue() Doc.name = self.GetTitleWgt().GetValue() Doc.doc_type_oid = self.GetTypeWgt().GetValue() Index: PanGalactic/pangalactic/client/modules/dm/ms2alert.py diff -u PanGalactic/pangalactic/client/modules/dm/ms2alert.py:1.3 PanGalactic/pangalactic/client/modules/dm/ms2alert.py:1.4 --- PanGalactic/pangalactic/client/modules/dm/ms2alert.py:1.3 Fri Mar 5 16:18:09 2004 +++ PanGalactic/pangalactic/client/modules/dm/ms2alert.py Sun Aug 8 22:53:45 2004 @@ -153,7 +153,7 @@ self.doc = self.word.Documents.Add(Template="C:\Nasa\data\GSFC4-36_new.doc") self.fieldcount = self.doc.FormFields.Count for k in range (1, self.fieldcount+1): - print "%s %s: <%s>" % (k, self.doc.FormFields(k).short_description, self.doc.FormFields(k).Result) + print "%s %s: <%s>" % (k, self.doc.FormFields(k).description, self.doc.FormFields(k).Result) self.getFormFieldValues() @@ -161,7 +161,7 @@ self.doc = self.word.Documents.Add(inputfilename) self.fieldcount = self.doc.FormFields.Count for k in range (1, self.fieldcount+1): - print "%s %s: <%s>" % (k, self.doc.FormFields(k).short_description, self.doc.FormFields(k).Result) + print "%s %s: <%s>" % (k, self.doc.FormFields(k).description, self.doc.FormFields(k).Result) self.getFormFieldValues() @@ -175,14 +175,14 @@ self.tdoc = self.word.Documents.Add(Template="C:\Nasa\data\GSFC4-36_new.doc") self.fieldcount = self.tdoc.FormFields.Count for k in range (1, self.fieldcount+1): - print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).short_description, self.tdoc.FormFields(k).Result) + print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).description, self.tdoc.FormFields(k).Result) def Generate (self): """Save the modified template to the output file.""" self.fieldcount = self.tdoc.FormFields.Count # for k in range (1, self.fieldcount+1): -# print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).short_description, self.tdoc.FormFields(k).Result) +# print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).description, self.tdoc.FormFields(k).Result) self.tdoc.SaveAs (self.outfilename) def previewDocument(self): @@ -248,10 +248,10 @@ if self.fieldcount > 0: for k in gsfc436Fields.keys(): if self.doc: -# print "%s %s: <%s>" % (k, self.doc.FormFields(k).short_description, self.doc.FormFields(k).Result) +# print "%s %s: <%s>" % (k, self.doc.FormFields(k).description, self.doc.FormFields(k).Result) self.formFields[self.doc.FormFields(k).Name] = self.doc.FormFields(k).Result elif self.tdoc: -# print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).short_description, self.tdoc.FormFields(k).Result) +# print "%s %s: <%s>" % (k, self.tdoc.FormFields(k).description, self.tdoc.FormFields(k).Result) self.formFields[self.tdoc.FormFields(k).Name] = self.tdoc.FormFields(k).Result return self.formFields Index: PanGalactic/pangalactic/client/modules/psm/pgefedittree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.43 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.44 --- PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.43 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefedittree.py Sun Aug 8 22:53:45 2004 @@ -88,6 +88,10 @@ """Loads the tree from the data in the local database.""" #print "pgefedittree.loadtreefromobjects" + if type(rootobj) == str: + rootobj = dm.getLookupObject(rootobj) + if not rootobj: + return AcuIds = [] highlightednode = None @@ -106,12 +110,13 @@ localacus = dm.getLocalAcus(dm.CurrentProject) for acuid, acuobj in localacus.items(): - if acuobj._assembly.pgef_oid == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: + if (acuobj.assembly == rootobj.pgef_oid + and acuobj.state <> objectstatus.DELETE): AcuIds.append(acuid) for acuid in AcuIds: acuobj = dm.getLookupObject(acuid) - itemobj = acuobj._component + itemobj = dm.getLookupObject(acuobj.component) if itemobj and acuobj.state <> objectstatus.DELETE: treeid = self.AppendItem(rootnode, itemobj.id) Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.8 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.9 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.8 Fri Jul 9 14:08:59 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Sun Aug 8 22:53:45 2004 @@ -180,18 +180,18 @@ return self.GetIdentifier().SetValue(modelobj.id) self.GetName().SetValue(modelobj.name) - self.GetPoc().SetValue(modelobj.creator_oid) - self.GetNomenclature().SetValue(modelobj.short_description) - self.GetDesc().SetValue(modelobj.long_description) + self.GetPoc().SetValue(modelobj.creator) + self.GetNomenclature().SetValue(modelobj.description) + self.GetDesc().SetValue(modelobj.comment) self.temp_model = modelobj def fillObject(self, modelobj): modelobj.id = self.GetIdentifier().GetValue() modelobj.name = self.GetName().GetValue() - modelobj.creator_oid = self.GetPoc().GetValue() - modelobj.short_description = self.GetNomenclature().GetValue() - modelobj.long_description = self.GetDesc().GetValue() + modelobj.creator = self.GetPoc().GetValue() + modelobj.description = self.GetNomenclature().GetValue() + modelobj.comment = self.GetDesc().GetValue() modelobj._upload_file_name = self.getFilename() return modelobj Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.141 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.142 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.141 Fri Jul 9 14:08:59 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Sun Aug 8 22:53:45 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.141 $"[11:-2] +__version__ = "$Revision: 1.142 $"[11:-2] import copy import types @@ -235,11 +235,11 @@ elif classname == "Model": self.rootobjs[self.ModelPage] = rootobj - if rootobj._of_part: - self.rootobjs[self.PartPage] = rootobj._of_part - self.rootobjs[self.PropertiesPage] = rootobj._of_part - self.rootobjs[self.PartsListPage] = rootobj._of_part - self.rootobjs[self.PartDataPage] = rootobj._of_part + if rootobj.of_part: + self.rootobjs[self.PartPage] = rootobj.of_part + self.rootobjs[self.PropertiesPage] = rootobj.of_part + self.rootobjs[self.PartsListPage] = rootobj.of_part + self.rootobjs[self.PartDataPage] = rootobj.of_part self.currentpage = self.ModelPage elif classname == "PartsList": @@ -251,7 +251,7 @@ self.currentpage = self.DocPage - def setupPane(self, rootobj, nodedata = None): + def setupPane(self, rootobj, nodedata=None): if not rootobj: return @@ -262,9 +262,9 @@ currentform = self.partform elif classname == "Model": currentform = self.modelform - elif which_pane == self.PartsListPage: + elif classname == "PartsList": currentform = self.partslistform - elif which_pane == self.DocPage: + elif classname == "Document": currentform = self.documentform if currentform: @@ -273,10 +273,11 @@ self.BuildTree(rootobj, classname) root = self.tree.GetRootItem() - self.tree.SelectItem(root) + if root: + self.tree.SelectItem(root) - def setMode(self, mode = BROWSE_MODE): + def setMode(self, mode=BROWSE_MODE): if mode == NEW_MODE: self.CreatingMode(self.currentpage) elif mode == EDIT_MODE: @@ -362,7 +363,7 @@ self.dm.creatingDocument, self.currentpage) - def PageChanged(self, event = None): + def PageChanged(self, event=None): #print "itemeditframe.pagechanged" self.currentpage = self.editnb.GetSelection() @@ -766,7 +767,7 @@ link.product = "ROOT" #self.rootitemid link.document = self.currentobj.pgef_oid link.state = objectstatus.ADD - link.InitObject(self.State.currentprojectname, self.dm.user.id) + link.initObject(self.State.currentprojectname, self.dm.user.id) self.dm.add([link]) self.dm.addProjectObjects(self.State.currentprojectname, [link]) @@ -1188,8 +1189,8 @@ # tmp = part.Part(_project = self.dm.CurrentProject) # self.partform.fillForm(tmp) - #changed following line to use IsEqual, was DataEqual - if tmp.IsEqual(self.currentobj): + #changed following line to use isEqual, was DataEqual + if tmp.isEqual(self.currentobj): print "dataequal:objects = tbd. what is supposed to be going on here?" else: retval = True @@ -1200,8 +1201,8 @@ # tmp = model.Model(_project = self.dm.CurrentProject) # self.modelform.fillForm(tmp) - #changed following line to use IsEqual, was DataEqual - if tmp.IsEqual(self.currentobj): + #changed following line to use isEqual, was DataEqual + if tmp.isEqual(self.currentobj): print "dataequal:objects = tbd. what is supposed to be going on here?" else: retval = True @@ -1210,8 +1211,8 @@ # tmp = PartsList(id = 'tempid__11') tmp = self.dm.newObject("PartsList") self.partslistform.fillObject(tmp) - #changed following line to use IsEqual, was DataEqual - if tmp.IsEqual(self.currentobj): + #changed following line to use isEqual, was DataEqual + if tmp.isEqual(self.currentobj): print "dataequal:objects = tbd. what is supposed to be going on here?" else: retval = True @@ -1220,8 +1221,8 @@ # tmp = Document(id = 'tempid__12') tmp = self.dm.newObject("Document") self.documentform.fillObject(tmp) - #changed following line to use IsEqual, was DataEqual - if tmp.IsEqual(self.currentobj): + #changed following line to use isEqual, was DataEqual + if tmp.isEqual(self.currentobj): print "dataequal:objects = tbd. what is supposed to be going on here?" else: retval = True Index: PanGalactic/pangalactic/client/modules/psm/searchframe.py diff -u PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.39 PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.39 Thu Jun 10 01:10:28 2004 +++ PanGalactic/pangalactic/client/modules/psm/searchframe.py Sun Aug 8 22:53:45 2004 @@ -222,7 +222,7 @@ attrlist = [] searchattrdict = {} - attrlist.append(("owner_oid", "like", "smallberries")) # self.dm.user.id)) # testing only - change back RSN + attrlist.append(("owner", "like", "smallberries")) # self.dm.user.id)) # testing only - change back RSN searchattrdict["Part"] = attrlist searchattrdict["Model"] = attrlist searchattrdict["Document"] = attrlist Index: PanGalactic/pangalactic/client/tests/test_itemeditframe.py diff -u PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.17 PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.18 --- PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.17 Fri Mar 5 16:18:12 2004 +++ PanGalactic/pangalactic/client/tests/test_itemeditframe.py Sun Aug 8 22:53:46 2004 @@ -60,7 +60,7 @@ testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 2, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) - temppl.owner_oid = 'me' + temppl.owner = 'me' temppl.id = '1111' testframe.itemeditform.partslistform.FillFormWithObjectData(temppl) @@ -121,7 +121,7 @@ testframe.itemeditform.itemform.FillFormWithObjectData(tempitem) testitem = productmodelversion.ProductModelVersion() - testitem.creator_oid = 'me' + testitem.creator = 'me' testitem.create_datetime = '12432' testframe.itemeditform.currentitem = testitem @@ -161,7 +161,7 @@ def testOnSavePartsList(self): temppl = partslist.PartsList() partslist.FillSamplePartsList(temppl) - temppl.owner_oid = 'me' + temppl.owner = 'me' temppl.id = '1111' temppl._upload_file_name = 'sample.xls' temppl.PLM_Converted = 1 Index: PanGalactic/pangalactic/client/tests/test_person.py diff -u PanGalactic/pangalactic/client/tests/test_person.py:1.9 PanGalactic/pangalactic/client/tests/test_person.py:1.10 --- PanGalactic/pangalactic/client/tests/test_person.py:1.9 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/client/tests/test_person.py Sun Aug 8 22:53:46 2004 @@ -41,7 +41,7 @@ ##==> (postgres) removed from schema assert self.obj1.Room == '', 'Bad initial values for Room' ##==> (postgres) removed from schema assert self.obj1.Internal == '', 'Bad initial values for Internal' - assert self.obj1.god_flag == '', 'Bad initial values for God' + assert self.obj1.god == '', 'Bad initial values for God' ##==> (postgres) removed from schema assert self.obj1.Person_Tds == '', 'Bad initial values for Person_Tds' assert len(self.obj1.Roles.keys()) == 0, 'Bad initial values for Roles' From waterbug at ned.gsfc.nasa.gov Sun Aug 8 22:59:49 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 22:59:51 2004 Subject: [Pangalactic-commits] Remove obsolete org data file. Message-ID: <200408090259.i792xnWo018231@ned.gsfc.nasa.gov> Modified files: PanGalactic/data/organizations.tsv 1.5 None Log message: Remove obsolete org data file. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:17:32 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:17:34 2004 Subject: [Pangalactic-commits] Doc mods. Message-ID: <200408090317.i793HWjr018311@ned.gsfc.nasa.gov> Modified files: PanGalactic/doc/PgefDevGuide.txt 1.6 1.7 PanGalactic/doc/PgefReference.txt 1.12 1.13 Log message: Doc mods. Index: PanGalactic/doc/PgefDevGuide.txt diff -u PanGalactic/doc/PgefDevGuide.txt:1.6 PanGalactic/doc/PgefDevGuide.txt:1.7 --- PanGalactic/doc/PgefDevGuide.txt:1.6 Mon Jul 19 10:18:42 2004 +++ PanGalactic/doc/PgefDevGuide.txt Sun Aug 8 23:17:31 2004 @@ -3,8 +3,8 @@ ======================================================================= :Author: Stephen Waterbury -:Version: $Revision: 1.6 $ -:Date: $Date: 2004/07/19 14:18:42 $ +:Version: $Revision: 1.7 $ +:Date: $Date: 2004/08/09 03:17:31 $ ------------ @@ -26,42 +26,55 @@ Scope ===== -The scope of the Pan Galactic Engineering Framework is intended -to support all engineering applications and their integration -with each other and with other enterprise applications. +The scope of the Pan Galactic Ontology is intended to include all +information relevant to products and product models throughout +the product life cycle. Architecture ============ -The PgefRoadmap provides high-level view; this document provides more -detail for software developers. +[PgefRoadmap provides high-level view ... this doc provides more +detail for software developers.] Software Components of PGEF --------------------------- -* XML-RPC interface +* XML-RPC interface: PgerXmlrpc - uses XML-RPC 'struct' idiom - is easy to communicate with a prototype with * PGER - - is a logical interface layer - - knows generic PGEF schema (core PGEF ontology) - - implemented as a Twisted "MultiService" - - drives all external interfaces (XML-RPC, SOAP, etc.) - -* Chronosynclastic Infundibulum - - - at the heart of PGER - - asynchronous object-relational repository - - schema is based on application domain ontology + * is a logical interface layer above the object-relational + hyperdatabase (the Chronosynclastic Infundibulum) + * knows generic PGEF schema (core PGEF ontology) + * implemented as a Twisted "MultiService" + * drives all external interfaces (XML-RPC, SOAP, etc.) + +* The Chronosynclastic Infundibulum + + * an asynchronous, ontology-aware hyperdatabase + + - "asynchronous": + uses Twisted's adbapi; event-based framework with + non-blocking functions that return "deferred" + place-holders that are called back with results + when they become available. + + - "ontology-aware": + The database schema is defined by an ontology, and + can be extended by adding other ontologies and/or + ontological classes ("OntoClasses") + + - "hyperdatabase": implements flexible O-R mapping, generating + sql database from "OntoClass" definitions * Client GUI - - provides a GUI for various PGEF functions - - contains modules for object editing, updating, etc. + * provides a GUI for various PGEF functions + * contains modules for object editing, updating, etc. Infrastructure Services @@ -70,14 +83,12 @@ Notes on XML-RPC search interface --------------------------------- -search(classname, refs, subtypes, args) - -:: +search(ocid, refs, subtypes, args) where: - classname = name of the class whose instances are being - searched for + ocid = id (name) of the OntoClass whose instances are + being searched for refs = 0 -> don't get objects referred to in _refs 1 -> do " " " " " " @@ -96,47 +107,76 @@ Some examples of valid 'args' lists: -:: +* [('pgef_oid', '=', 'admin')] - [('pgef_oid', '=', 'admin')] +* [('pgef_oid', 'like', 'smallberries')] - [('pgef_oid', 'like', 'smallberries')] +* [('create_datetime', '<', '2004-02-02')] - [('create_datetime', '<', '2004-02-02')] + Note: for datetime searches, dates must be in ISO format: + YYYY-MM-DD [HH:MM:SS] - Note: for datetime searches, dates must be in ISO format: - YYYY-MM-DD [HH:MM:SS] +* [('publish_date', 'is', 'null'), + ('pger_create_datetime', 'is not', 'null')] - [('publish_date', 'is', 'null'), - ('pger_create_datetime', 'is not', 'null')] + Note: for null searches, the operator *must* be 'is' or 'is + not' and the value *must* be 'null' (they are both + case-insensitive). - Note: for null searches, the operator *must* be 'is' or 'is - not' and the value *must* be 'null' (they are both - case-insensitive). +* [('change_flag', 'boolean', 1), + ('validated_flag', 'boolean', 0)] - [('change_flag', 'boolean', 1), - ('validated_flag', 'boolean', 0)] + Note: for boolean searches, the operator must be 'boolean' + (case-insensitive) and the value must be 1 or 0. - Note: for boolean searches, the operator must be 'boolean' - (case-insensitive) and the value must be 1 or 0. +* [('parent_oid', 'in', + ['admin.1086874967.03', 'admin.1086874967.16', + 'admin.1086874967.57', 'admin.1086874967.72', + 'admin.1086874967.87', 'admin.1086874968.16', + 'admin.1086874966.9'])] - [('parent_oid', 'in', - ['admin.1086874967.03', 'admin.1086874967.16', - 'admin.1086874967.57', 'admin.1086874967.72', - 'admin.1086874967.87', 'admin.1086874968.16', - 'admin.1086874966.9'])] - - Note: for searches of lists of values, the operator can be - 'in' or 'not in'. + Note: in searches of lists of values, the operator can be + either 'in' or 'not in'. Enterprise Ontology =================== -The Pan Galactic Engineering Repository (PGER) schema forms the -"base ontology" that PGEF applications extend. Familiarity with -the base ontology will enable the developer to extend it in an -application -- see: [ PgefReference ] +The PanGalactic ontology forms the "base ontology" that PGEF +applications extend. Familiarity with the base ontology will +enable the developer to extend it in an application -- see: +[PgefReference]. + +Notes on OntoProperties +----------------------- + +(See also the docstrings in pangalactic.meta.ontoproperty) + +* Every OntoProperty has a 'pgef_datatype' (default value: + 'str'), which must be one of: 'str', 'int', 'bool', 'DateTime', + or the id of a registered OntoClass (in which case its + 'property_type' must be set to 'object'). If the + OntoProperty's value is an aggregate of objects, then + 'max_cardinality' must be either an integer greater than 1 or + (if the aggregate is unlimited in size) 0. + +* An OntoProperty can have a default value, which is specified in + the 'default' attribute and must be encoded as a string. The + "default default" values are the null of each type: + + - Strings: are literal (default default: '') + - Integers: are cast to int (default default: 0) + - Booleans: '' == False; any non-empty string == True + (default default: False) + - DateTime: DateTime-valued OntoProperties have a default of + None. [Note that this does not pertain to + "initialization" values -- e.g., the + initialization value for 'create_datetime' is + DateTime.now().] + - Classes: object-valued OntoProperties (cf. + owl:ObjectProperty) have a default of None if + their max_cardinality == 1; otherwise, the + default is an empty list ([]). -------------------------- @@ -159,6 +199,5 @@ ----------------- - -$Id: PgefDevGuide.txt,v 1.6 2004/07/19 14:18:42 waterbug Exp $ +$Id: PgefDevGuide.txt,v 1.7 2004/08/09 03:17:31 waterbug Exp $ Index: PanGalactic/doc/PgefReference.txt diff -u PanGalactic/doc/PgefReference.txt:1.12 PanGalactic/doc/PgefReference.txt:1.13 --- PanGalactic/doc/PgefReference.txt:1.12 Mon Jul 19 10:18:42 2004 +++ PanGalactic/doc/PgefReference.txt Sun Aug 8 23:17:31 2004 @@ -4,8 +4,8 @@ :Author: Stephen Waterbury :Author: Ginny Keech -:Version: $Revision: 1.12 $ -:Date: $Date: 2004/07/19 14:18:42 $ +:Version: $Revision: 1.13 $ +:Date: $Date: 2004/08/09 03:17:31 $ ------------ @@ -18,15 +18,16 @@ computer-literate end-users, and contributors to PGEF. -------------------- -The PGEF GUI Client -------------------- +-------------------- +GUI Client Interface +-------------------- -This section describes the wxPython-based PGEF Client. +This section describes the wxPython-based Pan Galactic Client, +PanGalaxian. -Testing the PGEF Client ------------------------ +Testing PanGalaxian +------------------- There are a handful of existing tests that are up-to-date. Some are batch-mode; most are interactive, since they test the gui. @@ -36,148 +37,103 @@ Before you even start testing, make sure you have removed any test data, and remove pgef.cfg from the client directory. -* Start the application -* Select your repository -* Enter your username and email in the window -* Login -* Select the H2G2 project - - - See all the data show up - -* Select a model. Preferable HOG.1-CAD - - - See the pretty tree - -* Double-click on HOG.1-CAD in the tree - - - See the pretty editor - - Close the editor window - -* Double-click on the HOG.1-CAD in the grid - - - See the editor again - - Close it again - -* Click on a plus in the tree - - - See the tree expand - - The plus disappears if there are no children - -* Select Tools->Search... - - - The Search window appears - - Specify at least 1 search criterion - - Click [Search] - - + if successful: - - * See the Summary page with result counts - * Click on the tabs of each result type (e.g., Part, Model) - - - See an overview of each result type - - * Click on the Criteria tab - - + else: - - * Click [OK] on the Search Error window - - - Repeat as many times as you like - - Close the window - -* Select File->New->Part... - - - See the Part wizard - - Enter a part number at least - - Enter any additional data you wish - - Click [Save] - - The tree is rebuilt, showing your new part - - Close this window - - Your part is at the bottom of the Part tab in the main window (grey background) - -* Select File->New->Model... - - - See the Model wizard - - Enter a model identifier and model name at least - - Enter any additional data you wish - - Click [Save] - - The tree is rebuilt, showing your new model - - Close this window - - Your model is at the bottom of the Model tab in the main window (grey background) - -* Select File->New->Parts List... - - - See the Parts List wizard - - + If running on Windows - - * tbd - - + Else - - * Click [Save] - * Your parts list is added to the tree - - - Close this window - -* Select File->New->Document... +Start the application +Select your repository +Enter your username and email in the window +Login +Select the H2G2 project + See all the data show up +Select a model. Preferable HOG.1-CAD + See the pretty tree +Double-click on HOG.1-CAD in the tree + See the pretty editor + Close the editor window +Double-click on the HOG.1-CAD in the grid + See the editor again + Close it again +Click on a plus in the tree + See the tree expand + The plus disappears if there are no children +Select Tools->Search... + The Search window appears + Specify at least 1 search criterion + Click [Search] + if successful + See the Summary page with result counts + Click on the tabs of each result type (e.g., Part, Model) + See an overview of each result type + Click on the Criteria tab + else + Click [OK] on the Search Error window + Repeat as many times as you like + Close the window +Select File->New->Part... + See the Part wizard + Enter a part number at least + Enter any additional data you wish + Click [Save] + The tree is rebuilt, showing your new part + Close this window + Your part is at the bottom of the Part tab in the main window (grey background) +Select File->New->Model... + See the Model wizard + Enter a model identifier and model name at least + Enter any additional data you wish + Click [Save] + The tree is rebuilt, showing your new model + Close this window + Your model is at the bottom of the Model tab in the main window (grey background) +Select File->New->Parts List... + See the Parts List wizard + If running on Windows + tbd + Else + Click [Save] + Your parts list is added to the tree + Close this window +Select File->New->Document... + See the Document wizard + Enter as much data as you wish + Click [Save] + Your document is added to the tree + Close this window +Select File->Export->Properties... + tbd +Select File->Export->Table Data... + See the PDF creation window + Select [Generate PDF for the table] + Specify the output filename + Enter the header and footer lines, if any + Specify any additional options + Click [Create] + Click [OK] on the message window +Right-click on the Model grid + See the PDF creation window + Select [Generate PDF for the table] + Specify the output filename + Enter the header and footer lines, if any + Specify any additional options + Click [Create] + Click [OK] on the message window +Select Tools->Local Database Browser... + See the local browser + Select an entry in the list + See the grid fill with data + Repeat for as many as you like + Close this window +Select Repository->View My Stuff... + if you have created anything that is on the server + See the Search window with the Summary results page + else + Click [OK] on the Search Error window + Close the Search window + + +---------------------------------------------------- +Building a self-extracting executable of PanGalaxian +---------------------------------------------------- - - See the Document wizard - - Enter as much data as you wish - - Click [Save] - - Your document is added to the tree - - Close this window - -* Select File->Export->Properties... - - + tbd - -* Select File->Export->Table Data... - - - See the PDF creation window - - Select [Generate PDF for the table] - - Specify the output filename - - Enter the header and footer lines, if any - - Specify any additional options - - Click [Create] - - Click [OK] on the message window - -* Right-click on the Model grid - - - See the PDF creation window - - Select [Generate PDF for the table] - - Specify the output filename - - Enter the header and footer lines, if any - - Specify any additional options - - Click [Create] - - Click [OK] on the message window - -* Select Tools->Local Database Browser... - - - See the local browser - - Select an entry in the list - - See the grid fill with data - - Repeat for as many as you like - - Close this window - -* Select Repository->View My Stuff... - - - if you have created anything that is on the server - - + See the Search window with the Summary results page - - - else - - + Click [OK] on the Search Error window - - - Close the Search window - - -Building the PGEF Client Executable ------------------------------------ - -Build the self-extracting executable for the PGEF Client on a -Windows W2K machine. +Build the executable on a Windows W2K machine. You must have the following software installed in order to build an executable. This is in addition to any software required to @@ -205,13 +161,12 @@ The steps are: -* Create a fnord.exe -* Test Test Test -* Create a setup.exe -* Test this, too -* Copy the setup.exe to the download area on the server as - - pangalactic_xxx_setup.exe +Create a fnord.exe +Test Test Test +Create a setup.exe +Test this, too +Copy the setup.exe to the download area on the server as + pangalactic_xxx_setup.exe a. Create a fnord.exe @@ -265,12 +220,12 @@ /usr/local/apps/ned/www/beta --------------------------- -The PGEF Repository (PGER) --------------------------- +---------------------------------------------- +The Pan Galactic Engineering Repository (PGER) +---------------------------------------------- -The Pan Galactic repository includes a database, a file "vault", -and a full text search engine, among other things. +[Under construction] +This section will provide info on PGER. -------------------------------------- PGEF OID's: Unique Object Identifiers @@ -308,9 +263,9 @@ attribute. --------------------------------------------------- -The PGEF Ontology and the Repository (PGER) Schema --------------------------------------------------- +------------------------------------- +The PGEF Ontology and the PGER Schema +------------------------------------- The Pan Galactic Engineering Repository (PGER) schema forms the "base ontology" that PGEF applications extend. @@ -321,7 +276,8 @@ enterprise. To that end, PGEF implements a simple ontology of the most basic classes that occur in most enterprises: -[ this should be generated from the p.enterprise OntoClasses ] +[ this should be included from the comments in the +createPgerDbTables.sql script ] @@ -349,27 +305,24 @@ The idiomatic way is -:: - - class SomeOtherService - # .... do something interesting here - def registry(self): - return self.parent.getServiceNamed('registry') - - def makeService(config): - s = RegistryService() - s.setName('registry') - anotherS = SomeOtherService() - m = service.MultiService() - s.setServiceParent(m) - anotherS.setServiceParent(m) - return m - --------------------------------------------------------------- +class SomeOtherService + # .... do something interesting here + def registry(self): + return self.parent.getServiceNamed('registry') + +def makeService(config): + s = RegistryService() + s.setName('registry') + anotherS = SomeOtherService() + m = service.MultiService() + s.setServiceParent(m) + anotherS.setServiceParent(m) + return m The trick is to have 's' and 'anotherS' completely symmetrical, and allow them to access each other. +-------------------------------------------------------------- @@ -377,39 +330,25 @@ Troubleshooting --------------- -Problem: --------- - -Invoking Acrobat Reader on linux using version 5.0.8 aborts. - -Workaround: ------------ - -1. Edit the acroread script, which should be +Problem: Invoking Acrobat Reader on linux using version 5.0.8 aborts. -:: +Workaround: Edit the acroread script, which should be + /bin/acroread. - /bin/acroread. + Right after the line which begins: -2. Right after the line which begins: + install_dir= -:: + add: - install_dir= + export LANG=C -add: - -:: - - export LANG=C - -This fix assumes you are running bash. Modify the line -appropriately for other shells. + This fix assumes you are running bash. Modify the + line appropriately for other shells. -------- - -$Id: PgefReference.txt,v 1.12 2004/07/19 14:18:42 waterbug Exp $ +$Id: PgefReference.txt,v 1.13 2004/08/09 03:17:31 waterbug Exp $ From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:28:09 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:28:15 2004 Subject: [Pangalactic-commits] Mods to scripts that load data. Message-ID: <200408090328.i793S9Oa018390@ned.gsfc.nasa.gov> Modified files: PanGalactic/src/sql/admininit.py 1.2 1.3 PanGalactic/src/sql/cagedatamunge.py 1.3 1.4 PanGalactic/src/sql/copyOrganizations.psql 1.4 1.5 PanGalactic/src/sql/createPgerDbTables.sql 1.95 1.96 PanGalactic/src/sql/dropPgerDbTables.sql 1.28 1.29 PanGalactic/src/sql/fscdatamunge.py 1.6 1.7 PanGalactic/src/sql/insertACUs.sql 1.7 1.8 PanGalactic/src/sql/insertMediaTypes.sql 1.3 1.4 PanGalactic/src/sql/insertModels.sql 1.3 1.4 PanGalactic/src/sql/insertParts.sql 1.3 1.4 PanGalactic/src/sql/insertRefData.sql 1.10 1.11 PanGalactic/src/sql/insertTestData.sql 1.8 1.9 PanGalactic/src/sql/populate_pgerdb.sh 1.6 1.7 PanGalactic/src/sql/metaDb.sql 1.2 None Log message: Mods to scripts that load data. Index: PanGalactic/src/sql/copyOrganizations.psql diff -u PanGalactic/src/sql/copyOrganizations.psql:1.4 PanGalactic/src/sql/copyOrganizations.psql:1.5 --- PanGalactic/src/sql/copyOrganizations.psql:1.4 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/copyOrganizations.psql Sun Aug 8 23:28:06 2004 @@ -1 +1 @@ -\copy organization from ../../data/organizations.tsv +\copy _organization from ../../home/data/organizations.tsv with null '' Index: PanGalactic/src/sql/cagedatamunge.py diff -u PanGalactic/src/sql/cagedatamunge.py:1.3 PanGalactic/src/sql/cagedatamunge.py:1.4 --- PanGalactic/src/sql/cagedatamunge.py:1.3 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/cagedatamunge.py Sun Aug 8 23:28:06 2004 @@ -1,29 +1,57 @@ -"""Insert CAGE data from a tab-delimited file into PGERDB""" +"""Insert CAGE data from the DLSC file into PGERDB""" from pyPgSQL import PgSQL -from twisted.enterprise import adbapi -from pangalactic.repo.db import PgerDb +from pangalactic.utils import sql -conn = PgSQL.connect(database='pgerdb') -curs = conn.cursor() -connpool = adbapi.ConnectionPool('pyPgSQL.PgSQL', database='pgerdb') -db = PgerDb(connpool) +cageheaders = [ + '_id', # CAGE Code + '_name1', + '_name2', + '_name3', + '_name4', + '_name5', + '_country_code', + '_address1', + '_address2', + '_city', + '_state', + '_zip_code', + '_tel_nbr', + '_association_cage', + '_status', + '_type', + '_replacement_cage', + '_sic_code1', + '_sic_code2', + '_sic_code3', + '_sic_code4' + ] + +cagekw = {} +# set the common column values ... +cagekw['_onto_class'] = 'Organization' +cagekw['_id_context'] = 'CAGE' +cagekw['_pger_owner'] = 'admin' +cagekw['_pger_creator'] = 'admin' +cagekw['_owner_org'] = 'DLIS' -datafile = open('/home/waterbug/repo/NED/data/cagetest.tsv') -cagelist = datafile.readlines() -for r in cagelist: - cagelist[cagelist.index(r)] = r[:-1].split('\t') +cagefile = open('/usr/local/data/cage/eeepart_cage.txt') +namecodefile = open('/usr/local/data/cage/eeepart_cage_name_codes.tsv') -headerfile = open('/home/waterbug/repo/NED/data/cageheaders') -cageheaders = headerfile.readline()[:-1].split('\t') +namecodedict = {} +for line in namecodefile: + rec = line[:-1].split('\t') + cagenc[rec[0]] = rec[1] -for rec in cagelist: - cagekw = {} +conn = PgSQL.connect(database='pgerdb') +curs = conn.cursor() +for line in cagefile: + rec = line[:-1].split('|') for col in cageheaders: cagekw[col] = rec[cageheaders.index(col)] - # add an id_context ... - cagekw['id_context'] = 'DEMO' - cage_args = db._buildInsert('organizations', **cagekw) + if cagekw['_id'] in cagenc: + cagekw['_org_name_code'] = cagenc[cagekw['_id']] + cage_args = sql.buildInsert('_organization', **cagekw) curs.execute(*cage_args) conn.commit() Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.10 PanGalactic/src/sql/insertRefData.sql:1.11 --- PanGalactic/src/sql/insertRefData.sql:1.10 Thu May 27 17:02:32 2004 +++ PanGalactic/src/sql/insertRefData.sql Sun Aug 8 23:28:07 2004 @@ -1,6 +1,6 @@ /* PGERDB reference data initialization. */ -/* $Id: insertRefData.sql,v 1.10 2004/05/27 21:02:32 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.11 2004/08/09 03:28:07 waterbug Exp $ */ /* This script sets up the default identification contexts for * PGEF objects, and is required before the PGERDB can be @@ -9,16 +9,16 @@ BEGIN; SET CONSTRAINTS ALL DEFERRED; -INSERT INTO person +INSERT INTO _person ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - org_oid, - god_flag + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _org, + _god ) VALUES ( @@ -32,15 +32,15 @@ '1' ); -INSERT INTO person +INSERT INTO _person ( - pgef_oid, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - org_oid, - god_flag + _pgef_oid, + _id, + _id_context, + _pger_owner, + _pger_creator, + _org, + _god ) VALUES ( @@ -53,41 +53,33 @@ '0' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.admin.PGER', - 'admin', - 'PGER' + 'admin' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.test.PGER', - 'test', - 'PGER' + 'test' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -100,15 +92,15 @@ 'Pan Galactic Assigned Names Authority' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -121,21 +113,21 @@ 'Internet Assigned Numbers Authority' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - pgef_org_name_code, - name1, - country_code, - street_address1, - city, - state_or_country, - zip_or_postal_zone + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _org_name_code, + _name, + _country_code, + _street_address1, + _city, + _state_or_country, + _zip_or_postal_zone ) VALUES ( @@ -154,15 +146,15 @@ '00000' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -175,16 +167,16 @@ 'Defense Logistics Agency' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name, - association_cage + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name, + _association_cage ) VALUES ( @@ -198,16 +190,16 @@ 'DLA' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name, - association_cage + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name, + _association_cage ) VALUES ( @@ -221,16 +213,16 @@ 'GIDEP' ); -INSERT INTO project +INSERT INTO _project ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name, - short_description + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name, + _description ) VALUES ( @@ -244,285 +236,4 @@ 'No project specified' ); -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description -) -VALUES -( - 'PGEFAdvisory', - 'OntoClass', - 'PGA', - 'PGER', - 'admin', - 'admin', - 'PGANA', - 'PGA', - 0, - 'PGEF Advisory', - 'PGEF Advisory, Mother of all Alert/Advisory document types in PGER.' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPAlert', - 'OntoClass', - 'AL', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'AL', - 0, - 'Alert', - 'GIDEP Alert', - 'An Alert reports problems with parts, components, materials, specifications, test equipment, or manufacturing processes that can cause a functional failure. These documents require notification of the manufacturer prior to publication. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPProblemAdvisory', - 'OntoClass', - 'PA', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'PA', - 0, - 'Problem Advisory', - 'GIDEP Problem Advisory', - 'A Problem Advisory reports (1) preliminary information on a suspected problem, or (2) a problem with parts, components, materials, manufacturing processes, specification on test equipment that has an unknown or low probability of causing a functional failure. Also report preliminary information on a suspected problem, or a problem with test equipment. -These documents require notification of the manufacturer prior to publication. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPSafeAlert', - 'OntoClass', - 'SA', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'SA', - 0, - 'Safe-Alert', - 'GIDEP Safe-Alert', - 'A Safe-Alert reports problems which relate to the safety of personnel or equipment. -These documents require notification of the manufacturer prior to publication. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPDMSMS', - 'OntoClass', - 'DS', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'DS', - 0, - 'Diminishing Manufacturing Sources', - 'GIDEP Diminishing Manufacturing Sources', - 'A notice by the manufacturers that they are discontinuing production of a part, component or material, sold as a single item. The DMSMS Notice is also used to supplement the original notice of potential solutions. These supplemental notices are assigned as amendments to the original notices to maintain continuity. -Also include notices of discontinuation for test, measurement, and diagnostic equipment, which are metrology-related data. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPProductChangeNotice', - 'OntoClass', - 'PC', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'PC', - 0, - 'Product Change Notice', - 'GIDEP Product Change Notice', - 'A notice that a manufacturer (or government activity) has received approval to change the Class 1 characteristics of a part or component or material, as defined in MIL-STD-480, for parts controlled by government specifications. In the case of commercial off-the-shelf parts, the manufacturer may issue a product change notice without prior government coordination, unless specifically restricted by contractual instruments. Also include notices of approved change for test, measurement, and diagnostic equipment, which are metrology-related data. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPAgencyActionNotice', - 'OntoClass', - 'AN', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'AN', - 0, - 'Agency Action Notice', - 'GIDEP Agency Action Notice', - 'A notice that redistributes problem or general information issued by a government agency. These notices may have a Limited Distribution to government agencies only. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'GIDEPUrgentDataRequest', - 'OntoClass', - 'UDR', - 'GIDEP', - 'admin', - 'admin', - 'GIDEP', - 'UDR', - 0, - 'Urgent Data Request', - 'GIDEP Urgent Data Request', - 'A document issued to query the GIDEP community for information related to a problem or a part. [Source: GIDEP]' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - owner_org_oid, - base_id, - iteration, - name, - short_description, - long_description -) -VALUES -( - 'NASAPartAdvisory', - 'OntoClass', - 'NPA', - 'NASA', - 'admin', - 'admin', - 'GIDEP', - 'NPA', - 0, - 'NASA Part Advisory', - 'NASA Part Advisory', - 'A NASA Part Advisory reports problems with parts, components, materials, specifications, test equipment, or manufacturing processes that can cause a functional failure.' -); - END; - Index: PanGalactic/src/sql/insertACUs.sql diff -u PanGalactic/src/sql/insertACUs.sql:1.7 PanGalactic/src/sql/insertACUs.sql:1.8 --- PanGalactic/src/sql/insertACUs.sql:1.7 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/insertACUs.sql Sun Aug 8 23:28:07 2004 @@ -1,320 +1,320 @@ /* PGER Demo NAUO data. */ -/* $Id: insertACUs.sql,v 1.7 2004/03/05 21:18:18 waterbug Exp $ */ +/* $Id: insertACUs.sql,v 1.8 2004/08/09 03:28:07 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.41', -- pgef_oid -'acu-1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'DriveMod1', -- ref_designator -'TEST.HOG.1-CAD.1', -- assembly_oid -'TEST.IDrive.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.41', -- _pgef_oid +'acu-1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'DriveMod1', -- _ref_designator +'TEST.HOG.1-CAD.1', -- _assembly +'TEST.IDrive.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.42', -- pgef_oid -'acu-2', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'Brain1', -- ref_designator -'TEST.HOG.1-CAD.1', -- assembly_oid -'TEST.B57SMB.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.42', -- _pgef_oid +'acu-2', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'Brain1', -- _ref_designator +'TEST.HOG.1-CAD.1', -- _assembly +'TEST.B57SMB.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.43', -- pgef_oid -'acu-3', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'Flux1', -- ref_designator -'TEST.HOG.1-CAD.1', -- assembly_oid -'TEST.FX-CAP.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.43', -- _pgef_oid +'acu-3', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'Flux1', -- _ref_designator +'TEST.HOG.1-CAD.1', -- _assembly +'TEST.FX-CAP.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.44', -- pgef_oid -'acu-4', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'Pwr1', -- ref_designator -'TEST.HOG.1-CAD.1', -- assembly_oid -'TEST.MF Series A.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.44', -- _pgef_oid +'acu-4', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'Pwr1', -- _ref_designator +'TEST.HOG.1-CAD.1', -- _assembly +'TEST.MF Series A.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.45', -- pgef_oid -'acu-5', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'OTh1', -- ref_designator -'TEST.HOG.1-CAD.1', -- assembly_oid -'TEST.OO-1.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.45', -- _pgef_oid +'acu-5', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'OTh1', -- _ref_designator +'TEST.HOG.1-CAD.1', -- _assembly +'TEST.OO-1.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.46', -- pgef_oid -'acu-6', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'TwAssy1', -- ref_designator -'TEST.OO-1.1-CAD.1', -- assembly_oid -'TEST.BTA-20.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.46', -- _pgef_oid +'acu-6', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'TwAssy1', -- _ref_designator +'TEST.OO-1.1-CAD.1', -- _assembly +'TEST.BTA-20.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.47', -- pgef_oid -'acu-7', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'Tw1', -- ref_designator -'TEST.BTA-20.1-CAD.1', -- assembly_oid -'TEST.MMT-01.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.47', -- _pgef_oid +'acu-7', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'Tw1', -- _ref_designator +'TEST.BTA-20.1-CAD.1', -- _assembly +'TEST.MMT-01.1-CAD.1' -- _component ); -INSERT INTO acu +INSERT INTO _acu ( -pgef_oid, -id, -id_context, -pgef_security_mask, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -ref_designator, -assembly_oid, -component_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_ref_designator, +_assembly, +_component ) VALUES ( -'banzai@banzai.earth.1036203962.48', -- pgef_oid -'acu-8', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'', -- name -'H1', -- ref_designator -'TEST.BTA-20.1-CAD.1', -- assembly_oid -'TEST.HM.200.1-CAD.1' -- component_oid +'banzai@banzai.earth.1036203962.48', -- _pgef_oid +'acu-8', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'', -- _name +'H1', -- _ref_designator +'TEST.BTA-20.1-CAD.1', -- _assembly +'TEST.HM.200.1-CAD.1' -- _component ); Index: PanGalactic/src/sql/admininit.py diff -u PanGalactic/src/sql/admininit.py:1.2 PanGalactic/src/sql/admininit.py:1.3 --- PanGalactic/src/sql/admininit.py:1.2 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/admininit.py Sun Aug 8 23:28:06 2004 @@ -1,8 +1,8 @@ """Initialize admin credentials""" -# $Id: admininit.py,v 1.2 2004/03/05 21:18:18 waterbug Exp $ +# $Id: admininit.py,v 1.3 2004/08/09 03:28:06 waterbug Exp $ -__version__ = "$Revision: 1.2 $"[11:-2] +__version__ = "$Revision: 1.3 $"[11:-2] from pyPgSQL import PgSQL import sha @@ -11,10 +11,8 @@ conn = PgSQL.connect(database='pgerdb') curs = conn.cursor() -curs.execute("""UPDATE credential SET password = %s - WHERE owner_oid = %s and system_oid='PGER'""", +curs.execute("""UPDATE _passwd SET _password = %s WHERE _pgef_oid = %s""", (adminpass, 'admin')) - conn.commit() conn.close() Index: PanGalactic/src/sql/createPgerDbTables.sql diff -u PanGalactic/src/sql/createPgerDbTables.sql:1.95 PanGalactic/src/sql/createPgerDbTables.sql:1.96 --- PanGalactic/src/sql/createPgerDbTables.sql:1.95 Wed Jun 2 13:27:13 2004 +++ PanGalactic/src/sql/createPgerDbTables.sql Sun Aug 8 23:28:06 2004 @@ -1,6 +1,6 @@ /* Pan Galactic Engineering Repository Database (PGERDB) Table Creation Script */ -/* $Id: createPgerDbTables.sql,v 1.95 2004/06/02 17:27:13 waterbug Exp $ +/* $Id: createPgerDbTables.sql,v 1.96 2004/08/09 03:28:06 waterbug Exp $ * * *** TO DO *** * -- TBR (Text-Based Requirements) @@ -116,26 +116,20 @@ * of the transaction owner's id and the timestamp of * the transaction in Universal Time. Exceptions to this * are noted in the table versioned_object. */ - pgef_class TEXT DEFAULT 'PgefObject', - /* PgefClass indicates the PGEF pangalactic.enterprise - * class from which a given database row is derived. */ onto_class TEXT DEFAULT 'PgefObject', - /* [This will eventually be a foreign key to the - * onto_class table.] OntoClass indicates what type of - * application object a given database row is mapped - * into. The default OntoClass for each table is set at - * table creation time, but it may be overridden for any - * specific row and set to a custom application object - * class. */ + /* OntoClass indicates what type of application object a + * given database row is mapped into. The default + * OntoClass for each table is set at table creation + * time, but it may be overridden for any specific row + * and set to a custom application object class. */ id TEXT, - /* [PDME] Identifiable, [STEP] id, usually. Id is an - * identifier that is unique within some specified - * context (specified by the id_context). Initially, the - * population of id/id_context is somewhat arbitrary; - * however, in the envisioned canonical format, id should - * be a local name and id_context should be a namespace, - * and the pgef_oid should be the combination of the two - * into a URI. */ + /* [STEP: id, usually.] Id is an identifier that is + * unique within some specified context (specified by the + * id_context). Initially, the population of + * id/id_context is somewhat arbitrary; however, in a + * canonical format, id should be a local name and + * id_context should be a namespace, and the combination + * of the two should form a URI. */ id_context TEXT DEFAULT 'PGER', /* [PDME][STEP] Identifiable. id_context is the * namespace within which the id is unique. */ @@ -265,7 +259,7 @@ CREATE INDEX triple_rdf_property_value_idx ON triple (rdf_property_value); -CREATE TABLE media +CREATE TABLE media_type /* Reference table for MIME types/subtypes. The standard * MIME types defined at: * ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types @@ -278,8 +272,8 @@ /* (Inherited from PgefObject.) */ onto_class TEXT DEFAULT 'Media', /* (Inherited from PgefObject.) */ - media_type TEXT, - media_subtype TEXT + mime_type TEXT, + mime_subtype TEXT ) INHERITS (pgef_object); @@ -432,21 +426,12 @@ CREATE TABLE person -- [STEP, PDME, X.500] - /* In [PDME], the Person interface inherits address from - * Party; in the PGERDB Schema, a Person gets an address - * by being associated with an Organization. PGEF Person - * maps to [STEP] person_organization. A PGEF Person can be - * (1) a specific person affiliated with an organization + /* [STEP: person_organization]. A PGEF Person can be (1) a + * specific person affiliated with an organization * (optionally, with a role specified), (2) just a role and - * an organization, without a person specified, (3) just an - * organization. A Person representing the owner of - * something can have any of these 3 possible manifestations. - * - * NOTE: - * Because PostgreSQL inheritance does not yet support - * inheritance of primary and foreign key constraints, PGEF - * users are kept in this table rather than in a child table - * (as would be preferable). */ + * an organization, without a person specified. A Person + * representing the owner of something can have either of + * these manifestations. */ ( pgef_oid TEXT PRIMARY KEY, /* (Inherited from PgefObject.) @@ -497,8 +482,7 @@ owner_oid TEXT, system_oid TEXT DEFAULT 'PGER', password VARCHAR(40), - /* (Inherited from PgefObject.) - * Secure Hash Algorithm (SHA-1) digest of the user's + /* Secure Hash Algorithm (SHA-1) digest of the user's * password. */ permission_bit_mask INTEGER DEFAULT 0, /* Each user's permission_bit_mask is derived by adding @@ -843,10 +827,8 @@ CREATE TABLE document -- [STEP, PDME] - /* The document classes -- Document, DocRep, and Dcu - * (Document Component Usage) are intended to support the - * whole spectrum of "structured product documents", - * including: + /* The PGEF Document class is intended to support the whole + * spectrum of "structured product documents", including: * -- blob documents, represented as metadata with paths * (which may be URL's) to file(s) * -- versioned and non-versioned documents Index: PanGalactic/src/sql/dropPgerDbTables.sql diff -u PanGalactic/src/sql/dropPgerDbTables.sql:1.28 PanGalactic/src/sql/dropPgerDbTables.sql:1.29 --- PanGalactic/src/sql/dropPgerDbTables.sql:1.28 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/dropPgerDbTables.sql Sun Aug 8 23:28:06 2004 @@ -1,20 +1,21 @@ DROP TABLE dcu CASCADE; DROP TABLE doc_pt_rel CASCADE; -DROP TABLE doc_file CASCADE; DROP TABLE document CASCADE; DROP TABLE acu CASCADE; -DROP TABLE model_file CASCADE; DROP TABLE model CASCADE; DROP TABLE part CASCADE; -DROP TABLE cat_cat_rel CASCADE; -DROP TABLE category CASCADE; +DROP TABLE onto_property CASCADE; +DROP TABLE oc_oc_rel CASCADE; +DROP TABLE onto_class CASCADE; DROP TABLE versioned_object CASCADE; DROP TABLE person_role CASCADE; DROP TABLE role CASCADE; +DROP TABLE credential CASCADE; DROP TABLE person CASCADE; DROP TABLE project CASCADE; DROP TABLE organization CASCADE; DROP TABLE pgef_file CASCADE; -DROP TABLE media CASCADE; +DROP TABLE media_type CASCADE; +DROP TABLE triple CASCADE; DROP TABLE id_context CASCADE; DROP TABLE pgef_object CASCADE; Index: PanGalactic/src/sql/fscdatamunge.py diff -u PanGalactic/src/sql/fscdatamunge.py:1.6 PanGalactic/src/sql/fscdatamunge.py:1.7 --- PanGalactic/src/sql/fscdatamunge.py:1.6 Fri Jun 4 17:59:18 2004 +++ PanGalactic/src/sql/fscdatamunge.py Sun Aug 8 23:28:06 2004 @@ -1,7 +1,7 @@ #!/usr/bin/env python """Insert FSC data from a tab-delimited file into PGERDB""" -# $Id: fscdatamunge.py,v 1.6 2004/06/04 21:59:18 waterbug Exp $ +# $Id: fscdatamunge.py,v 1.7 2004/08/09 03:28:06 waterbug Exp $ import string import os @@ -45,43 +45,40 @@ # 7 fsg notes # 8 (empty -- probably an artifact of splitting) - # So ... to fit the FSC definitions into the PGERDB - # definitions table, they will be reconfigured thusly: + # To fit the FSC definitions into the PGEF Fsc table, they + # will be mapped thusly: # 1 (fsc code) -> id # 2 (fsc name) -> name and short_description # (for now, make short_description the same as name) # 3 + 4 + 5 (fsc notes + includes + excludes) -> long_description # id_context = 'FSC' - longdesc = newrow[3] + ' ' + newrow[4] + ' ' + newrow[5] - pfl = [fsc, fsc, newrow[2].strip(), newrow[2].strip(), - longdesc.strip()] + cmt = newrow[3] + ' ' + newrow[4] + ' ' + newrow[5] + pfl = [fsc, fsc, newrow[2].strip(), cmt.strip()] # print 'final fields:' # pprint(pfl) # print '==============================' pgerfsclist.append(pfl) -fscheaders = ['pgef_oid', - 'id', - 'name', - 'short_description', - 'long_description'] +fscheaders = ['_pgef_oid', + '_id', + '_name', + '_description'] ofile = open('fsc.csv', 'w') w = csv.writer(ofile, quoting=csv.QUOTE_ALL) -fileheaders = ['id', 'name', 'short_description', 'long_description'] +fileheaders = ['_id', '_name', '_description'] w.writerow(fileheaders) for rec in pgerfsclist: fsckw = {} for col in fscheaders: fsckw[col] = rec[fscheaders.index(col)] - fsckw['id_context'] = 'FSC' - fsckw['version'] = 0 - fsckw['pger_owner_oid'] = 'admin' - fsckw['pger_creator_oid'] = 'admin' - fsckw['owner_org_oid'] = 'DLIS' - fsckw['project_oid'] = 'NOPROJECT' - fsc_args = buildInsert('onto_class', fsckw) + fsckw['_onto_class'] = 'Fsc' + fsckw['_id_context'] = 'FSC' + fsckw['_pger_owner'] = 'admin' + fsckw['_pger_creator'] = 'admin' + fsckw['_owner_org'] = 'DLIS' + fsc_args = buildInsert('_fsc', fsckw) curs.execute(*fsc_args) r = [] for h in fileheaders: Index: PanGalactic/src/sql/insertModels.sql diff -u PanGalactic/src/sql/insertModels.sql:1.3 PanGalactic/src/sql/insertModels.sql:1.4 --- PanGalactic/src/sql/insertModels.sql:1.3 Thu May 27 17:02:32 2004 +++ PanGalactic/src/sql/insertModels.sql Sun Aug 8 23:28:07 2004 @@ -1,558 +1,558 @@ -/* PGER Demo PartModel data inserts. */ +/* PGER Demo PartModel data inserts. */ -/* $Id: insertModels.sql,v 1.3 2004/05/27 21:02:32 waterbug Exp $ */ +/* $Id: insertModels.sql,v 1.4 2004/08/09 03:28:07 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.MMT-01.1-CAD.1', -'MMT-01.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Model of Twanger, Magic, Megawatt', -- short_description -'Blah blah Twanger', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Megawatt Magic Twanger Design Model', -- name -'MMT-01.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.MMT-01.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'MMT-01.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Model of Twanger, Magic, Megawatt', -- _description +'Blah blah Twanger', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Megawatt Magic Twanger Design Model', -- _name +'MMT-01.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.MMT-01.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.BTA-20.1-CAD.1', -'BTA-20.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Preliminary Twanging Assembly', -- short_description -'Blah blah blah Blooper Twanging Assy.', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Blooper Twanging Assembly', -- name -'BTA-20.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.BTA-20.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'BTA-20.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Preliminary Twanging Assembly', -- _description +'Blah blah blah Blooper Twanging Assy.', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Blooper Twanging Assembly', -- _name +'BTA-20.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.BTA-20.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.HM.200.1-CAD.1', -'HM.200-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Mabob, Hoogie', -- short_description -'Blah blah blah Hoogie Mabob', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Hoogie Mabob v1.2', -- name -'HM.200-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.HM.200.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'HM.200-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Mabob, Hoogie', -- _description +'Blah blah blah Hoogie Mabob', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Hoogie Mabob v1.2', -- _name +'HM.200-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.HM.200.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.IDrive.1-CAD.1', -'IDrive.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Drive, Improbability', -- short_description -'Blah Improbability Drive', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Drive, Improbability, v3B', -- name -'IDrive.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.IDrive.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'IDrive.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Drive, Improbability', -- _description +'Blah Improbability Drive', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Drive, Improbability, v3B', -- _name +'IDrive.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.IDrive.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.B57SMB.1-CAD.1', -'B57SMB.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Computer, Hyper-Quantum, Subfemto', -- short_description -'Blah blah blah Powerful Computer', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Computer, Hyper-Quantum, Subfemto', -- name -'B57SMB.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.B57SMB.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'B57SMB.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Computer, Hyper-Quantum, Subfemto', -- _description +'Blah blah blah Powerful Computer', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Computer, Hyper-Quantum, Subfemto', -- _name +'B57SMB.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.B57SMB.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.FX-CAP.1-CAD.1', -'FX-CAP.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Capacitor, Flux', -- short_description -'Blah Blah Flux Capacitor', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'FX-v4', -- name -'FX-CAP.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.FX-CAP.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'FX-CAP.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Capacitor, Flux', -- _description +'Blah Blah Flux Capacitor', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'FX-v4', -- _name +'FX-CAP.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.FX-CAP.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.HOG.1-CAD.1', -'HOG.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Heart of Gold Spacecraft', -- short_description -'Blah Blah Heart of Gold', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'HOG-42', -- name -'HOG.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.HOG.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'HOG.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Heart of Gold Spacecraft', -- _description +'Blah Blah Heart of Gold', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'HOG-42', -- _name +'HOG.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.HOG.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.MF Series A.1-CAD.1', -'MF Series A.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Mr. Fusion A10K version 1 3D MCAD Model', -- short_description -'Mr. Fusion A10K version 1 3D Mechanical CAD Design Model, Blah Blah', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Mr. Fusion A10K', -- name -'MF Series A.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.MF Series A.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'MF Series A.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Mr. Fusion A10K version 1 3D MCAD Model', -- _description +'Mr. Fusion A10K version 1 3D Mechanical CAD Design Model, Blah Blah', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Mr. Fusion A10K', -- _name +'MF Series A.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.MF Series A.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.OO-1.1-CAD.1', -'OO-1.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Overthruster, Oscillation', -- short_description -'Oscillation Overthruster', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'OO-1-A', -- name -'OO-1.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.OO-1.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'OO-1.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Overthruster, Oscillation', -- _description +'Oscillation Overthruster', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'OO-1-A', -- _name +'OO-1.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.OO-1.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); -INSERT INTO model +INSERT INTO _model ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -model_view, -of_part_oid, -frame_of_reference, -definition_context, -life_cycle_stage +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_model_view, +_of_part, +_frame_of_reference, +_definition_context, +_life_cycle_stage ) VALUES ( 'TEST.OO-Def-1.1-CAD.1', -'OO-Def-1.1-CAD.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Overthruster, Oscillation', -- short_description -'Def Oscillation Overthruster', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'lizardo@yoyodyne.planet10', -- owner_oid -'lizardo@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'lizardo@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'OO-Def-1 v.57', -- name -'OO-Def-1.1-CAD', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'icon', -- model_view -'TEST.OO-Def-1.1', -- of_part_oid -'concept definition', -- frame_of_reference -'administrative data', -- definition_context -'all' -- life_cycle_stage +'OO-Def-1.1-CAD.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Overthruster, Oscillation', -- _description +'Def Oscillation Overthruster', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'lizardo@yoyodyne.planet10', -- _owner +'lizardo@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'lizardo@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'OO-Def-1 v.57', -- _name +'OO-Def-1.1-CAD', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'icon', -- _model_view +'TEST.OO-Def-1.1', -- _of_part +'concept definition', -- _frame_of_reference +'administrative data', -- _definition_context +'all' -- _life_cycle_stage ); END; Index: PanGalactic/src/sql/insertParts.sql diff -u PanGalactic/src/sql/insertParts.sql:1.3 PanGalactic/src/sql/insertParts.sql:1.4 --- PanGalactic/src/sql/insertParts.sql:1.3 Thu May 27 17:02:32 2004 +++ PanGalactic/src/sql/insertParts.sql Sun Aug 8 23:28:07 2004 @@ -1,478 +1,478 @@ /* PGER Demo Part data insertion. */ -/* $Id: insertParts.sql,v 1.3 2004/05/27 21:02:32 waterbug Exp $ */ +/* $Id: insertParts.sql,v 1.4 2004/08/09 03:28:07 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.MMT-01.1', -- pgef_oid -'MMT-01.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Twanger, Magic, Heavy-Duty', -- short_description -'Prototype Plasma-Drive Magic Twanger', -- long_description -'smallberries@yoyodyne.planet10', -- pger_owner_oid -'smallberries@yoyodyne.planet10', -- pger_creator_oid -'smallberries@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Megawatt Magic Twanger', -- name -'MMT-01', -- base_id -1, -- iteration -'1.0', -- version -'H2G2', -- project_oid -'FGII' -- owner_org_oid +'TEST.MMT-01.1', -- _pgef_oid +'MMT-01.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Twanger, Magic, Heavy-Duty', -- _description +'Prototype Plasma-Drive Magic Twanger', -- _comment +'smallberries@yoyodyne.planet10', -- _pger_owner +'smallberries@yoyodyne.planet10', -- _pger_creator +'smallberries@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Megawatt Magic Twanger', -- _name +'MMT-01', -- _base_id +1, -- _iteration +'1.0', -- _version +'H2G2', -- _project +'FGII' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.BTA-20.1', -- pgef_oid -'BTA-20.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Twanging Assembly, Blooper', -- short_description -'Twanging Assembly with custom Blooper modules', -- long_description -'smallberries@yoyodyne.planet10', -- pger_owner_oid -'smallberries@yoyodyne.planet10', -- pger_creator_oid -'smallberries@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Blooper Twanging Assembly', -- name -'BTA-20', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.BTA-20.1', -- _pgef_oid +'BTA-20.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Twanging Assembly, Blooper', -- _description +'Twanging Assembly with custom Blooper modules', -- _comment +'smallberries@yoyodyne.planet10', -- _pger_owner +'smallberries@yoyodyne.planet10', -- _pger_creator +'smallberries@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Blooper Twanging Assembly', -- _name +'BTA-20', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.HM.200.1', -- pgef_oid -'HM.200.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Mabob, Hoogie', -- short_description -'Deluxe Hoogie Mabob Assembly', -- long_description -'smallberries@yoyodyne.planet10', -- pger_owner_oid -'smallberries@yoyodyne.planet10', -- pger_creator_oid -'smallberries@yoyodyne.planet10', -- pger_modifier_oid -'smallberries@yoyodyne.planet10', -- owner_oid -'smallberries@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Hoogie Mabob', -- name -'HM.200', -- base_id -1, -- iteration -'1.2', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.HM.200.1', -- _pgef_oid +'HM.200.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Mabob, Hoogie', -- _description +'Deluxe Hoogie Mabob Assembly', -- _comment +'smallberries@yoyodyne.planet10', -- _pger_owner +'smallberries@yoyodyne.planet10', -- _pger_creator +'smallberries@yoyodyne.planet10', -- _pger_modifier +'smallberries@yoyodyne.planet10', -- _owner +'smallberries@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'smallberries@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Hoogie Mabob', -- _name +'HM.200', -- _base_id +1, -- _iteration +'1.2', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.IDrive.1', -- pgef_oid -'IDrive.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Drive, Improbability', -- short_description -'Improbability Drive Unit, VROOM VROOM!', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Improbability Drive', -- name -'IDrive', -- base_id -1, -- iteration -'3B', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.IDrive.1', -- _pgef_oid +'IDrive.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Drive, Improbability', -- _description +'Improbability Drive Unit, VROOM VROOM!', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Improbability Drive', -- _name +'IDrive', -- _base_id +1, -- _iteration +'3B', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.B57SMB.1', -- pgef_oid -'B57SMB.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Computer, Hyper-Quantum, Subfemto', -- short_description -'Ridiculously Powerful But Tiny Computer', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Bambleweeny 57 Sub-Meson Brain', -- name -'B57SMB', -- base_id -1, -- iteration -'33', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.B57SMB.1', -- _pgef_oid +'B57SMB.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Computer, Hyper-Quantum, Subfemto', -- _description +'Ridiculously Powerful But Tiny Computer', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Bambleweeny 57 Sub-Meson Brain', -- _name +'B57SMB', -- _base_id +1, -- _iteration +'33', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.FX-CAP.1', -- pgef_oid -'FX-CAP.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Capacitor, Flux', -- short_description -'Quantum Chromolytic Flux Capacitor', -- long_description -'bigboote@yoyodyne.planet10', -- pger_owner_oid -'bigboote@yoyodyne.planet10', -- pger_creator_oid -'bigboote@yoyodyne.planet10', -- pger_modifier_oid -'bigboote@yoyodyne.planet10', -- owner_oid -'bigboote@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'bigboote@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Flux Capacitor', -- name -'FX-CAP', -- base_id -1, -- iteration -'4', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.FX-CAP.1', -- _pgef_oid +'FX-CAP.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Capacitor, Flux', -- _description +'Quantum Chromolytic Flux Capacitor', -- _comment +'bigboote@yoyodyne.planet10', -- _pger_owner +'bigboote@yoyodyne.planet10', -- _pger_creator +'bigboote@yoyodyne.planet10', -- _pger_modifier +'bigboote@yoyodyne.planet10', -- _owner +'bigboote@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'bigboote@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Flux Capacitor', -- _name +'FX-CAP', -- _base_id +1, -- _iteration +'4', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.HOG.1', -- pgef_oid -'HOG.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Space Hog', -- short_description -'Really Big Spacecraft', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Heart of Gold', -- name -'HOG', -- base_id -1, -- iteration -'42', -- version -'H2G2', -- project_oid -'BANZA' -- owner_org_oid +'TEST.HOG.1', -- _pgef_oid +'HOG.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Space Hog', -- _description +'Really Big Spacecraft', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Heart of Gold', -- _name +'HOG', -- _base_id +1, -- _iteration +'42', -- _version +'H2G2', -- _project +'BANZA' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.MF Series A.1', -- pgef_oid -'MF Series A.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Fusion Power Source, MF Series', -- short_description -'Omni-Fuel, Compact Semi-Portable Fusion Power Module', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Mr. Fusion', -- name -'MF Series A', -- base_id -1, -- iteration -'A10K', -- version -'H2G2', -- project_oid -'BANZA' -- owner_org_oid +'TEST.MF Series A.1', -- _pgef_oid +'MF Series A.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Fusion Power Source, MF Series', -- _description +'Omni-Fuel, Compact Semi-Portable Fusion Power Module', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Mr. Fusion', -- _name +'MF Series A', -- _base_id +1, -- _iteration +'A10K', -- _version +'H2G2', -- _project +'BANZA' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.OO-1.1', -- pgef_oid -'OO-1.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Overthruster, Oscillation', -- short_description -'Oscillation Overthruster, Class 1', -- long_description -'banzai@banzai.earth', -- pger_owner_oid -'banzai@banzai.earth', -- pger_creator_oid -'banzai@banzai.earth', -- pger_modifier_oid -'banzai@banzai.earth', -- owner_oid -'banzai@banzai.earth', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'banzai@banzai.earth', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Oscillation Overthruster', -- name -'OO-1', -- base_id -1, -- iteration -'A', -- version -'H2G2', -- project_oid -'BANZA' -- owner_org_oid +'TEST.OO-1.1', -- _pgef_oid +'OO-1.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Overthruster, Oscillation', -- _description +'Oscillation Overthruster, Class 1', -- _comment +'banzai@banzai.earth', -- _pger_owner +'banzai@banzai.earth', -- _pger_creator +'banzai@banzai.earth', -- _pger_modifier +'banzai@banzai.earth', -- _owner +'banzai@banzai.earth', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'banzai@banzai.earth', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Oscillation Overthruster', -- _name +'OO-1', -- _base_id +1, -- _iteration +'A', -- _version +'H2G2', -- _project +'BANZA' -- _owner_org ); -INSERT INTO part +INSERT INTO _part ( -pgef_oid, -id, -id_context, -pgef_security_mask, -short_description, -long_description, -pger_owner_oid, -pger_creator_oid, -pger_modifier_oid, -owner_oid, -creator_oid, -create_datetime, -modifier_oid, -mod_datetime, -name, -base_id, -iteration, -version, -project_oid, -owner_org_oid +_pgef_oid, +_id, +_id_context, +_security_mask, +_description, +_comment, +_pger_owner, +_pger_creator, +_pger_modifier, +_owner, +_creator, +_create_datetime, +_modifier, +_mod_datetime, +_name, +_base_id, +_iteration, +_version, +_project, +_owner_org ) VALUES ( -'TEST.OO-Def-1.1', -- pgef_oid -'OO-Def-1.1', -- id -'TEST', -- id_context -'0', -- pgef_security_mask -'Overthruster, Oscillation, Defective', -- short_description -'DO NOT USE This Oscillation Overthruster!!', -- long_description -'lizardo@yoyodyne.planet10', -- pger_owner_oid -'lizardo@yoyodyne.planet10', -- pger_creator_oid -'lizardo@yoyodyne.planet10', -- pger_modifier_oid -'lizardo@yoyodyne.planet10', -- owner_oid -'lizardo@yoyodyne.planet10', -- creator_oid -'2002-09-09 01:06:51', -- create_datetime -'lizardo@yoyodyne.planet10', -- modifier_oid -'2002-09-09 01:06:51', -- mod_datetime -'Defective Oscillation Overthruster', -- name -'OO-Def-1', -- base_id -1, -- iteration -'666', -- version -'H2G2', -- project_oid -'YOYOD' -- owner_org_oid +'TEST.OO-Def-1.1', -- _pgef_oid +'OO-Def-1.1', -- _id +'TEST', -- _id_context +'0', -- _security_mask +'Overthruster, Oscillation, Defective', -- _description +'DO NOT USE This Oscillation Overthruster!!', -- _comment +'lizardo@yoyodyne.planet10', -- _pger_owner +'lizardo@yoyodyne.planet10', -- _pger_creator +'lizardo@yoyodyne.planet10', -- _pger_modifier +'lizardo@yoyodyne.planet10', -- _owner +'lizardo@yoyodyne.planet10', -- _creator +'2002-09-09 01:06:51', -- _create_datetime +'lizardo@yoyodyne.planet10', -- _modifier +'2002-09-09 01:06:51', -- _mod_datetime +'Defective Oscillation Overthruster', -- _name +'OO-Def-1', -- _base_id +1, -- _iteration +'666', -- _version +'H2G2', -- _project +'YOYOD' -- _owner_org ); END; Index: PanGalactic/src/sql/insertTestData.sql diff -u PanGalactic/src/sql/insertTestData.sql:1.8 PanGalactic/src/sql/insertTestData.sql:1.9 --- PanGalactic/src/sql/insertTestData.sql:1.8 Thu May 27 17:02:32 2004 +++ PanGalactic/src/sql/insertTestData.sql Sun Aug 8 23:28:07 2004 @@ -1,20 +1,20 @@ /* Test data initialization script. * */ -/* $Id: insertTestData.sql,v 1.8 2004/05/27 21:02:32 waterbug Exp $ */ +/* $Id: insertTestData.sql,v 1.9 2004/08/09 03:28:07 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; -INSERT INTO project +INSERT INTO _project ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -27,15 +27,15 @@ 'Hitchhikers Guide to the Galaxy' ); -INSERT INTO project +INSERT INTO _project ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -48,15 +48,15 @@ 'The Other Test Project' ); -INSERT INTO project +INSERT INTO _project ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - name + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _name ) VALUES ( @@ -69,83 +69,22 @@ 'The Other Other Test Project' ); -INSERT INTO onto_class +INSERT INTO _person ( - pgef_oid, - pgef_class, - id, - id_context, - base_id, - pger_owner_oid, - pger_creator_oid, - name -) -VALUES -( - 'PGEF.OntoClass.TEST.Document', - 'OntoClass', - 'Document', - 'TEST', - 'Document', - 'admin', - 'admin', - 'Document' -); - -INSERT INTO onto_class -( - pgef_oid, - pgef_class, - id, - id_context, - base_id, - pger_owner_oid, - pger_creator_oid, - name -) -VALUES -( - 'PGEF.OntoClass.TEST.UserGuide', - 'OntoClass', - 'UserGuide', - 'TEST', - 'UserGuide', - 'admin', - 'admin', - 'User Guide' -); - -INSERT INTO oc_oc_rel -( - pgef_oid, - parent_oid, - child_oid, - ontology_oid -) -VALUES -( - 'PGEF.OcOcRel.TEST.1', - 'PGEF.OntoClass.TEST.Document', - 'PGEF.OntoClass.TEST.UserGuide', - 'Ontology.PGEF' -); - -INSERT INTO person -( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - email, - fname, - mi_or_name, - lname, - position_title, - org_oid, - phone, - god_flag + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _email, + _fname, + _mi_or_name, + _lname, + _position_title, + _org, + _phone, + _god ) VALUES ( @@ -165,34 +104,30 @@ '0' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.banzai@banzai.earth.PGER', - 'banzai@banzai.earth', - 'PGER' + 'banzai@banzai.earth' ); -INSERT INTO person +INSERT INTO _person ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - email, - fname, - mi_or_name, - lname, - position_title, - org_oid, - phone + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _email, + _fname, + _mi_or_name, + _lname, + _position_title, + _org, + _phone ) VALUES ( @@ -211,34 +146,30 @@ 'yoyofone' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.bigboote@yoyodyne.planet10.PGER', - 'bigboote@yoyodyne.planet10', - 'PGER' + 'bigboote@yoyodyne.planet10' ); -INSERT INTO person +INSERT INTO _person ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - email, - fname, - mi_or_name, - lname, - position_title, - org_oid, - phone + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _email, + _fname, + _mi_or_name, + _lname, + _position_title, + _org, + _phone ) VALUES ( @@ -257,34 +188,30 @@ 'yoyofone' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.smallberries@yoyodyne.planet10.PGER', - 'smallberries@yoyodyne.planet10', - 'PGER' + 'smallberries@yoyodyne.planet10' ); -INSERT INTO person +INSERT INTO _person ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - email, - fname, - mi_or_name, - lname, - position_title, - org_oid, - phone + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _email, + _fname, + _mi_or_name, + _lname, + _position_title, + _org, + _phone ) VALUES ( @@ -303,176 +230,172 @@ 'yoyofone' ); -INSERT INTO credential +INSERT INTO _passwd ( - pgef_oid, - owner_oid, - system_oid + _pgef_oid ) VALUES ( - 'PanGalactic.Credential.lizardo@yoyodyne.planet10.PGER', - 'lizardo@yoyodyne.planet10', - 'PGER' + 'lizardo@yoyodyne.planet10' ); -INSERT INTO organization -( - pgef_oid, - pgef_class, - id, - id_context, - pgef_security_mask, - name, - short_description, - long_description, - pger_owner_oid, - pger_creator_oid, - pger_create_datetime, - pger_modifier_oid, - pger_mod_datetime, - owner_oid, - creator_oid, - create_datetime, - modifier_oid, - mod_datetime, - pgef_org_name_code, - name1, - name2, - name3, - name4, - name5, - country_code, - street_address1, - street_address2, - city, - state_or_country, - zip_or_postal_zone, - phone, - association_cage, - status_code, - type_code, - replacement_cage, - sic_code1, - sic_code2, - sic_code3, - sic_code4 +INSERT INTO _organization +( + _pgef_oid, + _onto_class, + _id, + _id_context, + _security_mask, + _name, + _description, + _comment, + _pger_owner, + _pger_creator, + _pger_create_datetime, + _pger_modifier, + _pger_mod_datetime, + _owner, + _creator, + _create_datetime, + _modifier, + _mod_datetime, + _org_name_code, + _name1, + _name2, + _name3, + _name4, + _name5, + _country_code, + _street_address1, + _street_address2, + _city, + _state_or_country, + _zip_or_postal_zone, + _phone, + _association_cage, + _status_code, + _type_code, + _replacement_cage, + _sic_code1, + _sic_code2, + _sic_code3, + _sic_code4 ) VALUES ( 'YOYOD', 'Organization', 'YOYOD', 'TEST', '0', 'Yoyodyne Propulsion Systems', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'YOYODYNE', 'Yoyodyne Propulsion Systems', '', '', '', '', '1', '', '', 'Grovers Mills', 'NJ', '', '', '', '', '', '', '', '', '', '' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pgef_security_mask, - name, - short_description, - long_description, - pger_owner_oid, - pger_creator_oid, - pger_create_datetime, - pger_modifier_oid, - pger_mod_datetime, - owner_oid, - creator_oid, - create_datetime, - modifier_oid, - mod_datetime, - pgef_org_name_code, - name1, - name2, - name3, - name4, - name5, - country_code, - street_address1, - street_address2, - city, - state_or_country, - zip_or_postal_zone, - phone, - association_cage, - status_code, - type_code, - replacement_cage, - sic_code1, - sic_code2, - sic_code3, - sic_code4 + _pgef_oid, + _onto_class, + _id, + _id_context, + _security_mask, + _name, + _description, + _comment, + _pger_owner, + _pger_creator, + _pger_create_datetime, + _pger_modifier, + _pger_mod_datetime, + _owner, + _creator, + _create_datetime, + _modifier, + _mod_datetime, + _org_name_code, + _name1, + _name2, + _name3, + _name4, + _name5, + _country_code, + _street_address1, + _street_address2, + _city, + _state_or_country, + _zip_or_postal_zone, + _phone, + _association_cage, + _status_code, + _type_code, + _replacement_cage, + _sic_code1, + _sic_code2, + _sic_code3, + _sic_code4 ) VALUES ( 'BOZOI', 'Organization', 'BOZOI', 'TEST', '0', 'Bozo International', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'BOZOI', 'Bozo International', '', '', '', '', '1', '', '', 'Paris', 'TX', '', '', 'BOZOI', '', '', '', '', '', '', '' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pgef_security_mask, - name, - short_description, - long_description, - pger_owner_oid, - pger_creator_oid, - pger_create_datetime, - pger_modifier_oid, - pger_mod_datetime, - owner_oid, - creator_oid, - create_datetime, - modifier_oid, - mod_datetime, - pgef_org_name_code, - name1, - name2, - name3, - name4, - name5, - country_code, - street_address1, - street_address2, - city, - state_or_country, - zip_or_postal_zone, - phone, - association_cage, - status_code, - type_code, - replacement_cage, - sic_code1, - sic_code2, - sic_code3, - sic_code4 + _pgef_oid, + _onto_class, + _id, + _id_context, + _security_mask, + _name, + _description, + _comment, + _pger_owner, + _pger_creator, + _pger_create_datetime, + _pger_modifier, + _pger_mod_datetime, + _owner, + _creator, + _create_datetime, + _modifier, + _mod_datetime, + _org_name_code, + _name1, + _name2, + _name3, + _name4, + _name5, + _country_code, + _street_address1, + _street_address2, + _city, + _state_or_country, + _zip_or_postal_zone, + _phone, + _association_cage, + _status_code, + _type_code, + _replacement_cage, + _sic_code1, + _sic_code2, + _sic_code3, + _sic_code4 ) VALUES ( 'BANZA', 'Organization', 'BANZA', 'TEST', '0', 'Banzai Institute', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'BANZAI', 'Banzai Institute', '', '', '', '', '1', '', '', 'Holland Township', 'NJ', '', '', 'BOZOI', '', '', '', '', '', '', '' ); -INSERT INTO organization +INSERT INTO _organization ( - pgef_oid, - pgef_class, - id, - id_context, - pger_owner_oid, - pger_creator_oid, - pgef_org_name_code, - name, - name1, - country_code, - street_address1, - city, - state_or_country, - zip_or_postal_zone + _pgef_oid, + _onto_class, + _id, + _id_context, + _pger_owner, + _pger_creator, + _org_name_code, + _name, + _name1, + _country_code, + _street_address1, + _city, + _state_or_country, + _zip_or_postal_zone ) VALUES ( Index: PanGalactic/src/sql/populate_pgerdb.sh diff -u PanGalactic/src/sql/populate_pgerdb.sh:1.6 PanGalactic/src/sql/populate_pgerdb.sh:1.7 --- PanGalactic/src/sql/populate_pgerdb.sh:1.6 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/populate_pgerdb.sh Sun Aug 8 23:28:07 2004 @@ -1,16 +1,16 @@ #!/bin/bash -# $Id: populate_pgerdb.sh,v 1.6 2004/03/05 21:18:18 waterbug Exp $ +# $Id: populate_pgerdb.sh,v 1.7 2004/08/09 03:28:07 waterbug Exp $ psql pgerdb < insertRefData.sql psql pgerdb < insertMediaTypes.sql -psql pgerdb < copyOrganizations.psql +# psql pgerdb < copyOrganizations.psql psql pgerdb < insertTestData.sql -python fscdatamunge.py +# python fscdatamunge.py psql pgerdb < insertParts.sql psql pgerdb < insertModels.sql psql pgerdb < insertACUs.sql -psql pgerdb < insertDocuments.sql +# psql pgerdb < insertDocuments.sql python admininit.py Index: PanGalactic/src/sql/insertMediaTypes.sql diff -u PanGalactic/src/sql/insertMediaTypes.sql:1.3 PanGalactic/src/sql/insertMediaTypes.sql:1.4 --- PanGalactic/src/sql/insertMediaTypes.sql:1.3 Fri Mar 5 16:18:18 2004 +++ PanGalactic/src/sql/insertMediaTypes.sql Sun Aug 8 23:28:07 2004 @@ -12,6860 +12,6855 @@ */ -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/plain', -'Media', +'Mime', 'IANA', 'text', 'plain' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/richtext', -'Media', +'Mime', 'IANA', 'text', 'richtext' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/enriched', -'Media', +'Mime', 'IANA', 'text', 'enriched' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/tab-separated-values', -'Media', +'Mime', 'IANA', 'text', 'tab-separated-values' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/html', -'Media', +'Mime', 'IANA', 'text', 'html' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/sgml', -'Media', +'Mime', 'IANA', 'text', 'sgml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.latex-z', -'Media', +'Mime', 'IANA', 'text', 'vnd.latex-z' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.fmi.flexstor', -'Media', +'Mime', 'IANA', 'text', 'vnd.fmi.flexstor' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/uri-list', -'Media', +'Mime', 'IANA', 'text', 'uri-list' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.abc', -'Media', +'Mime', 'IANA', 'text', 'vnd.abc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/rfc822-headers', -'Media', +'Mime', 'IANA', 'text', 'rfc822-headers' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.in3d.3dml', -'Media', +'Mime', 'IANA', 'text', 'vnd.in3d.3dml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/prs.lines.tag', -'Media', +'Mime', 'IANA', 'text', 'prs.lines.tag' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.in3d.spot', -'Media', +'Mime', 'IANA', 'text', 'vnd.in3d.spot' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/css', -'Media', +'Mime', 'IANA', 'text', 'css' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/xml', -'Media', +'Mime', 'IANA', 'text', 'xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/xml-external-parsed-entity', -'Media', +'Mime', 'IANA', 'text', 'xml-external-parsed-entity' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/rtf', -'Media', +'Mime', 'IANA', 'text', 'rtf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/directory', -'Media', +'Mime', 'IANA', 'text', 'directory' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/calendar', -'Media', +'Mime', 'IANA', 'text', 'calendar' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.wap.wml', -'Media', +'Mime', 'IANA', 'text', 'vnd.wap.wml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.wap.wmlscript', -'Media', +'Mime', 'IANA', 'text', 'vnd.wap.wmlscript' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.fly', -'Media', +'Mime', 'IANA', 'text', 'vnd.fly' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.wap.sl', -'Media', +'Mime', 'IANA', 'text', 'vnd.wap.sl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.wap.si', -'Media', +'Mime', 'IANA', 'text', 'vnd.wap.si' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/t140', -'Media', +'Mime', 'IANA', 'text', 't140' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.ms-mediapackage', -'Media', +'Mime', 'IANA', 'text', 'vnd.ms-mediapackage' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.IPTC.NewsML', -'Media', +'Mime', 'IANA', 'text', 'vnd.IPTC.NewsML' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.IPTC.NITF', -'Media', +'Mime', 'IANA', 'text', 'vnd.IPTC.NITF' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.curl', -'Media', +'Mime', 'IANA', 'text', 'vnd.curl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/vnd.DMClientScript', -'Media', +'Mime', 'IANA', 'text', 'vnd.DMClientScript' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'text/parityfec', -'Media', +'Mime', 'IANA', 'text', 'parityfec' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/mixed', -'Media', +'Mime', 'IANA', 'multipart', 'mixed' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/alternative', -'Media', +'Mime', 'IANA', 'multipart', 'alternative' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/digest', -'Media', +'Mime', 'IANA', 'multipart', 'digest' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/parallel', -'Media', +'Mime', 'IANA', 'multipart', 'parallel' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/appledouble', -'Media', +'Mime', 'IANA', 'multipart', 'appledouble' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/header-set', -'Media', +'Mime', 'IANA', 'multipart', 'header-set' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/form-data', -'Media', +'Mime', 'IANA', 'multipart', 'form-data' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/related', -'Media', +'Mime', 'IANA', 'multipart', 'related' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/report', -'Media', +'Mime', 'IANA', 'multipart', 'report' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/voice-message', -'Media', +'Mime', 'IANA', 'multipart', 'voice-message' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/signed', -'Media', +'Mime', 'IANA', 'multipart', 'signed' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/encrypted', -'Media', +'Mime', 'IANA', 'multipart', 'encrypted' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'multipart/byteranges', -'Media', +'Mime', 'IANA', 'multipart', 'byteranges' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/rfc822', -'Media', +'Mime', 'IANA', 'message', 'rfc822' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/partial', -'Media', +'Mime', 'IANA', 'message', 'partial' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/external-body', -'Media', +'Mime', 'IANA', 'message', 'external-body' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/news', -'Media', +'Mime', 'IANA', 'message', 'news' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/http', -'Media', +'Mime', 'IANA', 'message', 'http' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/delivery-status', -'Media', +'Mime', 'IANA', 'message', 'delivery-status' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/disposition-notification', -'Media', +'Mime', 'IANA', 'message', 'disposition-notification' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'message/s-http', -'Media', +'Mime', 'IANA', 'message', 's-http' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/octet-stream', -'Media', +'Mime', 'IANA', 'application', 'octet-stream' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/postscript', -'Media', +'Mime', 'IANA', 'application', 'postscript' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/oda', -'Media', +'Mime', 'IANA', 'application', 'oda' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/atomicmail', -'Media', +'Mime', 'IANA', 'application', 'atomicmail' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/andrew-inset', -'Media', +'Mime', 'IANA', 'application', 'andrew-inset' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/slate', -'Media', +'Mime', 'IANA', 'application', 'slate' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/wita', -'Media', +'Mime', 'IANA', 'application', 'wita' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/dec-dx', -'Media', +'Mime', 'IANA', 'application', 'dec-dx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/dca-rft', -'Media', +'Mime', 'IANA', 'application', 'dca-rft' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/activemessage', -'Media', +'Mime', 'IANA', 'application', 'activemessage' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/rtf', -'Media', +'Mime', 'IANA', 'application', 'rtf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/applefile', -'Media', +'Mime', 'IANA', 'application', 'applefile' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/mac-binhex40', -'Media', +'Mime', 'IANA', 'application', 'mac-binhex40' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/news-message-id', -'Media', +'Mime', 'IANA', 'application', 'news-message-id' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/news-transmission', -'Media', +'Mime', 'IANA', 'application', 'news-transmission' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/wordperfect5.1', -'Media', +'Mime', 'IANA', 'application', 'wordperfect5.1' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pdf', -'Media', +'Mime', 'IANA', 'application', 'pdf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/zip', -'Media', +'Mime', 'IANA', 'application', 'zip' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/macwriteii', -'Media', +'Mime', 'IANA', 'application', 'macwriteii' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/msword', -'Media', +'Mime', 'IANA', 'application', 'msword' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/remote-printing', -'Media', +'Mime', 'IANA', 'application', 'remote-printing' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/mathematica', -'Media', +'Mime', 'IANA', 'application', 'mathematica' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/cybercash', -'Media', +'Mime', 'IANA', 'application', 'cybercash' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/commonground', -'Media', +'Mime', 'IANA', 'application', 'commonground' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/iges', -'Media', +'Mime', 'IANA', 'application', 'iges' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/riscos', -'Media', +'Mime', 'IANA', 'application', 'riscos' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/eshop', -'Media', +'Mime', 'IANA', 'application', 'eshop' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/x400-bp', -'Media', +'Mime', 'IANA', 'application', 'x400-bp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/sgml', -'Media', +'Mime', 'IANA', 'application', 'sgml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/cals-1840', -'Media', +'Mime', 'IANA', 'application', 'cals-1840' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pgp-encrypted', -'Media', +'Mime', 'IANA', 'application', 'pgp-encrypted' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pgp-signature', -'Media', +'Mime', 'IANA', 'application', 'pgp-signature' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pgp-keys', -'Media', +'Mime', 'IANA', 'application', 'pgp-keys' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.framemaker', -'Media', +'Mime', 'IANA', 'application', 'vnd.framemaker' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mif', -'Media', +'Mime', 'IANA', 'application', 'vnd.mif' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-excel', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-excel' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-powerpoint', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-powerpoint' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-project', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-project' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-works', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-works' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-tnef', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-tnef' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.svd', -'Media', +'Mime', 'IANA', 'application', 'vnd.svd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.music-niff', -'Media', +'Mime', 'IANA', 'application', 'vnd.music-niff' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-artgalry', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-artgalry' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.truedoc', -'Media', +'Mime', 'IANA', 'application', 'vnd.truedoc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.koan', -'Media', +'Mime', 'IANA', 'application', 'vnd.koan' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.street-stream', -'Media', +'Mime', 'IANA', 'application', 'vnd.street-stream' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fdf', -'Media', +'Mime', 'IANA', 'application', 'vnd.fdf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/set-payment-initiation', -'Media', +'Mime', 'IANA', 'application', 'set-payment-initiation' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/set-payment', -'Media', +'Mime', 'IANA', 'application', 'set-payment' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/set-registration-initiation', -'Media', +'Mime', 'IANA', 'application', 'set-registration-initiation' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/set-registration', -'Media', +'Mime', 'IANA', 'application', 'set-registration' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.seemail', -'Media', +'Mime', 'IANA', 'application', 'vnd.seemail' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.businessobjects', -'Media', +'Mime', 'IANA', 'application', 'vnd.businessobjects' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.meridian-slingshot', -'Media', +'Mime', 'IANA', 'application', 'vnd.meridian-slingshot' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.xara', -'Media', +'Mime', 'IANA', 'application', 'vnd.xara' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/sgml-open-catalog', -'Media', +'Mime', 'IANA', 'application', 'sgml-open-catalog' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.rapid', -'Media', +'Mime', 'IANA', 'application', 'vnd.rapid' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.enliven', -'Media', +'Mime', 'IANA', 'application', 'vnd.enliven' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-registration-wakeup', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-registration-wakeup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-verification-wakeup', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-verification-wakeup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-payment-wakeup', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-payment-wakeup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-directory-service', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-directory-service' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.intertrust.digibox', -'Media', +'Mime', 'IANA', 'application', 'vnd.intertrust.digibox' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.intertrust.nncp', -'Media', +'Mime', 'IANA', 'application', 'vnd.intertrust.nncp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/prs.alvestrand.titrax-sheet', -'Media', +'Mime', 'IANA', 'application', 'prs.alvestrand.titrax-sheet' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.noblenet-web', -'Media', +'Mime', 'IANA', 'application', 'vnd.noblenet-web' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.noblenet-sealer', -'Media', +'Mime', 'IANA', 'application', 'vnd.noblenet-sealer' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.noblenet-directory', -'Media', +'Mime', 'IANA', 'application', 'vnd.noblenet-directory' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/prs.nprend', -'Media', +'Mime', 'IANA', 'application', 'prs.nprend' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.webturbo', -'Media', +'Mime', 'IANA', 'application', 'vnd.webturbo' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/hyperstudio', -'Media', +'Mime', 'IANA', 'application', 'hyperstudio' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.shana.informed.formtemplate', -'Media', +'Mime', 'IANA', 'application', 'vnd.shana.informed.formtemplate' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.shana.informed.formdata', -'Media', +'Mime', 'IANA', 'application', 'vnd.shana.informed.formdata' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.shana.informed.package', -'Media', +'Mime', 'IANA', 'application', 'vnd.shana.informed.package' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.shana.informed.interchange ', -'Media', +'Mime', 'IANA', 'application', 'vnd.shana.informed.interchange ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.$commerce_battelle', -'Media', +'Mime', 'IANA', 'application', 'vnd.$commerce_battelle' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.osa.netdeploy', -'Media', +'Mime', 'IANA', 'application', 'vnd.osa.netdeploy' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ibm.MiniPay', -'Media', +'Mime', 'IANA', 'application', 'vnd.ibm.MiniPay' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-jpnstore-wakeup', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-jpnstore-wakeup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-setstore-wakeup', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-setstore-wakeup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-verification', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-verification' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.japannet-registration', -'Media', +'Mime', 'IANA', 'application', 'vnd.japannet-registration' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hp-HPGL', -'Media', +'Mime', 'IANA', 'application', 'vnd.hp-HPGL' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hp-PCL', -'Media', +'Mime', 'IANA', 'application', 'vnd.hp-PCL' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hp-PCLXL', -'Media', +'Mime', 'IANA', 'application', 'vnd.hp-PCLXL' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.musician', -'Media', +'Mime', 'IANA', 'application', 'vnd.musician' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.FloGraphIt', -'Media', +'Mime', 'IANA', 'application', 'vnd.FloGraphIt' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.intercon.formnet', -'Media', +'Mime', 'IANA', 'application', 'vnd.intercon.formnet' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vemmi', -'Media', +'Mime', 'IANA', 'application', 'vemmi' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-asf', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-asf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecdis-update', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecdis-update' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder6', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder6' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder6-s', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder6-s' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-wordpro', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-wordpro' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-approach', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-approach' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-1-2-3', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-1-2-3' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-organizer', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-organizer' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-screencam', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-screencam' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-freelance', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-freelance' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujitsu.oasys', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujitsu.oasys' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujitsu.oasys2', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujitsu.oasys2' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.swiftview-ics', -'Media', +'Mime', 'IANA', 'application', 'vnd.swiftview-ics' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.dna', -'Media', +'Mime', 'IANA', 'application', 'vnd.dna' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/prs.cww', -'Media', +'Mime', 'IANA', 'application', 'prs.cww' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wt.stf', -'Media', +'Mime', 'IANA', 'application', 'vnd.wt.stf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.dxr', -'Media', +'Mime', 'IANA', 'application', 'vnd.dxr' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mitsubishi.misty-guard.trustweb', -'Media', +'Mime', 'IANA', 'application', 'vnd.mitsubishi.misty-guard.trustweb' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ibm.modcap', -'Media', +'Mime', 'IANA', 'application', 'vnd.ibm.modcap' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.acucobol', -'Media', +'Mime', 'IANA', 'application', 'vnd.acucobol' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujitsu.oasys3', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujitsu.oasys3' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/marc', -'Media', +'Mime', 'IANA', 'application', 'marc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujitsu.oasysprs', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujitsu.oasysprs' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujitsu.oasysgp', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujitsu.oasysgp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.visio', -'Media', +'Mime', 'IANA', 'application', 'vnd.visio' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.netfpx', -'Media', +'Mime', 'IANA', 'application', 'vnd.netfpx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.audiograph ', -'Media', +'Mime', 'IANA', 'application', 'vnd.audiograph ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.epson.salt', -'Media', +'Mime', 'IANA', 'application', 'vnd.epson.salt' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.3M.Post-it-Notes', -'Media', +'Mime', 'IANA', 'application', 'vnd.3M.Post-it-Notes' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.novadigm.EDX', -'Media', +'Mime', 'IANA', 'application', 'vnd.novadigm.EDX' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.novadigm.EXT', -'Media', +'Mime', 'IANA', 'application', 'vnd.novadigm.EXT' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.novadigm.EDM', -'Media', +'Mime', 'IANA', 'application', 'vnd.novadigm.EDM' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.claymore', -'Media', +'Mime', 'IANA', 'application', 'vnd.claymore' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.comsocaller', -'Media', +'Mime', 'IANA', 'application', 'vnd.comsocaller' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkcs7-mime', -'Media', +'Mime', 'IANA', 'application', 'pkcs7-mime' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkcs7-signature', -'Media', +'Mime', 'IANA', 'application', 'pkcs7-signature' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkcs10', -'Media', +'Mime', 'IANA', 'application', 'pkcs10' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.yellowriver-custom-menu', -'Media', +'Mime', 'IANA', 'application', 'vnd.yellowriver-custom-menu' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.chart', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.chart' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.series', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.series' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.filerequest', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.filerequest' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.fileupdate', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.fileupdate' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.seriesrequest', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.seriesrequest' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ecowin.seriesupdate', -'Media', +'Mime', 'IANA', 'application', 'vnd.ecowin.seriesupdate' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/EDIFACT', -'Media', +'Mime', 'IANA', 'application', 'EDIFACT' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/EDI-X12', -'Media', +'Mime', 'IANA', 'application', 'EDI-X12' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/EDI-Consent', -'Media', +'Mime', 'IANA', 'application', 'EDI-Consent' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wrq-hp3000-labelled', -'Media', +'Mime', 'IANA', 'application', 'vnd.wrq-hp3000-labelled' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.minisoft-hp3000-save', -'Media', +'Mime', 'IANA', 'application', 'vnd.minisoft-hp3000-save' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ffsns', -'Media', +'Mime', 'IANA', 'application', 'vnd.ffsns' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hp-hps', -'Media', +'Mime', 'IANA', 'application', 'vnd.hp-hps' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujixerox.docuworks', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujixerox.docuworks' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/xml', -'Media', +'Mime', 'IANA', 'application', 'xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/xml-external-parsed-entity', -'Media', +'Mime', 'IANA', 'application', 'xml-external-parsed-entity' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/xml-dtd', -'Media', +'Mime', 'IANA', 'application', 'xml-dtd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.anser-web-funds-transfer-initiation', -'Media', +'Mime', 'IANA', 'application', 'vnd.anser-web-funds-transfer-initiation' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.anser-web-certificate-issue-initiation', -'Media', +'Mime', 'IANA', 'application', 'vnd.anser-web-certificate-issue-initiation' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.is-xpr', -'Media', +'Mime', 'IANA', 'application', 'vnd.is-xpr' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.intu.qbo', -'Media', +'Mime', 'IANA', 'application', 'vnd.intu.qbo' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.publishare-delta-tree', -'Media', +'Mime', 'IANA', 'application', 'vnd.publishare-delta-tree' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.cybank', -'Media', +'Mime', 'IANA', 'application', 'vnd.cybank' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/batch-SMTP', -'Media', +'Mime', 'IANA', 'application', 'batch-SMTP' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.alert', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.alert' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.cacheop', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.cacheop' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.list', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.list' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.listcmd', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.listcmd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.channel', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.channel' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.bearer-choice', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.bearer-choice' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.signal', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.signal' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.alert-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.alert-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.cacheop-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.cacheop-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.list-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.list-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.listcmd-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.listcmd-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.channel-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.channel-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.uplanet.bearer-choice-wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.uplanet.bearer-choice-wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.epson.quickanime', -'Media', +'Mime', 'IANA', 'application', 'vnd.epson.quickanime' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.commonspace', -'Media', +'Mime', 'IANA', 'application', 'vnd.commonspace' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fut-misnet', -'Media', +'Mime', 'IANA', 'application', 'vnd.fut-misnet' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.xfdl', -'Media', +'Mime', 'IANA', 'application', 'vnd.xfdl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.intu.qfx', -'Media', +'Mime', 'IANA', 'application', 'vnd.intu.qfx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.epson.ssf', -'Media', +'Mime', 'IANA', 'application', 'vnd.epson.ssf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.epson.msf', -'Media', +'Mime', 'IANA', 'application', 'vnd.epson.msf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder7', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder7' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder7-s', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder7-s' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.lotus-notes', -'Media', +'Mime', 'IANA', 'application', 'vnd.lotus-notes' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkixcmp', -'Media', +'Mime', 'IANA', 'application', 'pkixcmp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wap.wmlc', -'Media', +'Mime', 'IANA', 'application', 'vnd.wap.wmlc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wap.wmlscriptc', -'Media', +'Mime', 'IANA', 'application', 'vnd.wap.wmlscriptc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wap.wbxml', -'Media', +'Mime', 'IANA', 'application', 'vnd.wap.wbxml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.wem ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.wem ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.kmr ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.kmr ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.adsi ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.adsi ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.fis ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.fis ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.gotap ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.gotap ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.motorola.flexsuite.ttc ', -'Media', +'Mime', 'IANA', 'application', 'vnd.motorola.flexsuite.ttc ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ufdl', -'Media', +'Mime', 'IANA', 'application', 'vnd.ufdl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.accpac.simply.imp', -'Media', +'Mime', 'IANA', 'application', 'vnd.accpac.simply.imp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.accpac.simply.aso', -'Media', +'Mime', 'IANA', 'application', 'vnd.accpac.simply.aso' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.vcx', -'Media', +'Mime', 'IANA', 'application', 'vnd.vcx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/ipp', -'Media', +'Mime', 'IANA', 'application', 'ipp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/ocsp-request', -'Media', +'Mime', 'IANA', 'application', 'ocsp-request' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/ocsp-response', -'Media', +'Mime', 'IANA', 'application', 'ocsp-response' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.previewsystems.box', -'Media', +'Mime', 'IANA', 'application', 'vnd.previewsystems.box' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mediastation.cdkey', -'Media', +'Mime', 'IANA', 'application', 'vnd.mediastation.cdkey' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.pg.format', -'Media', +'Mime', 'IANA', 'application', 'vnd.pg.format' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.pg.osasli', -'Media', +'Mime', 'IANA', 'application', 'vnd.pg.osasli' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hp-hpid', -'Media', +'Mime', 'IANA', 'application', 'vnd.hp-hpid' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkix-cert', -'Media', +'Mime', 'IANA', 'application', 'pkix-cert' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/pkix-crl', -'Media', +'Mime', 'IANA', 'application', 'pkix-crl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.TXF', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.TXF' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.PLC', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.PLC' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.DIS', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.DIS' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.DAF', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.DAF' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.MSL', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.MSL' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.cups-raster', -'Media', +'Mime', 'IANA', 'application', 'vnd.cups-raster' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.cups-postscript', -'Media', +'Mime', 'IANA', 'application', 'vnd.cups-postscript' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.cups-raw ', -'Media', +'Mime', 'IANA', 'application', 'vnd.cups-raw ' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/index', -'Media', +'Mime', 'IANA', 'application', 'index' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/index.cmd', -'Media', +'Mime', 'IANA', 'application', 'index.cmd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/index.response', -'Media', +'Mime', 'IANA', 'application', 'index.response' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/index.obj', -'Media', +'Mime', 'IANA', 'application', 'index.obj' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/index.vnd', -'Media', +'Mime', 'IANA', 'application', 'index.vnd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.triscape.mxs', -'Media', +'Mime', 'IANA', 'application', 'vnd.triscape.mxs' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder75', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder75' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.powerbuilder75-s', -'Media', +'Mime', 'IANA', 'application', 'vnd.powerbuilder75-s' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.dpgraph', -'Media', +'Mime', 'IANA', 'application', 'vnd.dpgraph' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/http', -'Media', +'Mime', 'IANA', 'application', 'http' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/sdp', -'Media', +'Mime', 'IANA', 'application', 'sdp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.eudora.data', -'Media', +'Mime', 'IANA', 'application', 'vnd.eudora.data' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujixerox.docuworks.binder', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujixerox.docuworks.binder' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.vectorworks', -'Media', +'Mime', 'IANA', 'application', 'vnd.vectorworks' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.grafeq', -'Media', +'Mime', 'IANA', 'application', 'vnd.grafeq' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.bmi', -'Media', +'Mime', 'IANA', 'application', 'vnd.bmi' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ericsson.quickcall', -'Media', +'Mime', 'IANA', 'application', 'vnd.ericsson.quickcall' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hzn-3d-crossword', -'Media', +'Mime', 'IANA', 'application', 'vnd.hzn-3d-crossword' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wap.slc', -'Media', +'Mime', 'IANA', 'application', 'vnd.wap.slc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.wap.sic', -'Media', +'Mime', 'IANA', 'application', 'vnd.wap.sic' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-injector', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-injector' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fujixerox.ddd', -'Media', +'Mime', 'IANA', 'application', 'vnd.fujixerox.ddd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-account', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-account' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-identity-message', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-identity-message' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-tool-message', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-tool-message' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-tool-template', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-tool-template' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.groove-vcard', -'Media', +'Mime', 'IANA', 'application', 'vnd.groove-vcard' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ctc-posml', -'Media', +'Mime', 'IANA', 'application', 'vnd.ctc-posml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.canon-lips', -'Media', +'Mime', 'IANA', 'application', 'vnd.canon-lips' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.canon-cpdl', -'Media', +'Mime', 'IANA', 'application', 'vnd.canon-cpdl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.trueapp', -'Media', +'Mime', 'IANA', 'application', 'vnd.trueapp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.s3sms', -'Media', +'Mime', 'IANA', 'application', 'vnd.s3sms' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/iotp', -'Media', +'Mime', 'IANA', 'application', 'iotp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mcd', -'Media', +'Mime', 'IANA', 'application', 'vnd.mcd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.httphone', -'Media', +'Mime', 'IANA', 'application', 'vnd.httphone' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.informix-visionary', -'Media', +'Mime', 'IANA', 'application', 'vnd.informix-visionary' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.msign', -'Media', +'Mime', 'IANA', 'application', 'vnd.msign' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ms-lrm', -'Media', +'Mime', 'IANA', 'application', 'vnd.ms-lrm' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.contact.cmsg', -'Media', +'Mime', 'IANA', 'application', 'vnd.contact.cmsg' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.epson.esf', -'Media', +'Mime', 'IANA', 'application', 'vnd.epson.esf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/whoispp-query', -'Media', +'Mime', 'IANA', 'application', 'whoispp-query' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/whoispp-response', -'Media', +'Mime', 'IANA', 'application', 'whoispp-response' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mozilla.xul+xml', -'Media', +'Mime', 'IANA', 'application', 'vnd.mozilla.xul+xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/parityfec', -'Media', +'Mime', 'IANA', 'application', 'parityfec' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.palm', -'Media', +'Mime', 'IANA', 'application', 'vnd.palm' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.fsc.weblaunch', -'Media', +'Mime', 'IANA', 'application', 'vnd.fsc.weblaunch' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.tve-trigger', -'Media', +'Mime', 'IANA', 'application', 'vnd.tve-trigger' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/dvcs', -'Media', +'Mime', 'IANA', 'application', 'dvcs' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/sieve', -'Media', +'Mime', 'IANA', 'application', 'sieve' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.vividence.scriptfile', -'Media', +'Mime', 'IANA', 'application', 'vnd.vividence.scriptfile' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.hhe.lesson-player', -'Media', +'Mime', 'IANA', 'application', 'vnd.hhe.lesson-player' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/beep+xml', -'Media', +'Mime', 'IANA', 'application', 'beep+xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/font-tdpfr', -'Media', +'Mime', 'IANA', 'application', 'font-tdpfr' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.mseq', -'Media', +'Mime', 'IANA', 'application', 'vnd.mseq' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.aether.imp', -'Media', +'Mime', 'IANA', 'application', 'vnd.aether.imp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.MQY', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.MQY' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.Mobius.MBK', -'Media', +'Mime', 'IANA', 'application', 'vnd.Mobius.MBK' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.vidsoft.vidconference', -'Media', +'Mime', 'IANA', 'application', 'vnd.vidsoft.vidconference' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.ibm.afplinedata', -'Media', +'Mime', 'IANA', 'application', 'vnd.ibm.afplinedata' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.irepository.package+xml', -'Media', +'Mime', 'IANA', 'application', 'vnd.irepository.package+xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.sss-ntf', -'Media', +'Mime', 'IANA', 'application', 'vnd.sss-ntf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.sss-dtf', -'Media', +'Mime', 'IANA', 'application', 'vnd.sss-dtf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.sss-cod', -'Media', +'Mime', 'IANA', 'application', 'vnd.sss-cod' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.pvi.ptid1', -'Media', +'Mime', 'IANA', 'application', 'vnd.pvi.ptid1' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/isup', -'Media', +'Mime', 'IANA', 'application', 'isup' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/qsig', -'Media', +'Mime', 'IANA', 'application', 'qsig' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/timestamp-query', -'Media', +'Mime', 'IANA', 'application', 'timestamp-query' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/timestamp-reply', -'Media', +'Mime', 'IANA', 'application', 'timestamp-reply' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'application/vnd.pwg-xhtml-print+xml', -'Media', +'Mime', 'IANA', 'application', 'vnd.pwg-xhtml-print+xml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/jpeg', -'Media', +'Mime', 'IANA', 'image', 'jpeg' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/gif', -'Media', +'Mime', 'IANA', 'image', 'gif' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/ief', -'Media', +'Mime', 'IANA', 'image', 'ief' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/g3fax', -'Media', +'Mime', 'IANA', 'image', 'g3fax' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/tiff', -'Media', +'Mime', 'IANA', 'image', 'tiff' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/cgm', -'Media', +'Mime', 'IANA', 'image', 'cgm' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/naplps', -'Media', +'Mime', 'IANA', 'image', 'naplps' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.dwg', -'Media', +'Mime', 'IANA', 'image', 'vnd.dwg' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.svf', -'Media', +'Mime', 'IANA', 'image', 'vnd.svf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.dxf', -'Media', +'Mime', 'IANA', 'image', 'vnd.dxf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/png', -'Media', +'Mime', 'IANA', 'image', 'png' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.fpx', -'Media', +'Mime', 'IANA', 'image', 'vnd.fpx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.net-fpx', -'Media', +'Mime', 'IANA', 'image', 'vnd.net-fpx' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.xiff', -'Media', +'Mime', 'IANA', 'image', 'vnd.xiff' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/prs.btif', -'Media', +'Mime', 'IANA', 'image', 'prs.btif' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.fastbidsheet', -'Media', +'Mime', 'IANA', 'image', 'vnd.fastbidsheet' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.wap.wbmp', -'Media', +'Mime', 'IANA', 'image', 'vnd.wap.wbmp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/prs.pti', -'Media', +'Mime', 'IANA', 'image', 'prs.pti' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.cns.inf2', -'Media', +'Mime', 'IANA', 'image', 'vnd.cns.inf2' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.mix', -'Media', +'Mime', 'IANA', 'image', 'vnd.mix' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.fujixerox.edmics-rlc', -'Media', +'Mime', 'IANA', 'image', 'vnd.fujixerox.edmics-rlc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.fujixerox.edmics-mmr', -'Media', +'Mime', 'IANA', 'image', 'vnd.fujixerox.edmics-mmr' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'image/vnd.fst', -'Media', +'Mime', 'IANA', 'image', 'vnd.fst' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/basic', -'Media', +'Mime', 'IANA', 'audio', 'basic' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/32kadpcm', -'Media', +'Mime', 'IANA', 'audio', '32kadpcm' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.qcelp', -'Media', +'Mime', 'IANA', 'audio', 'vnd.qcelp' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.digital-winds', -'Media', +'Mime', 'IANA', 'audio', 'vnd.digital-winds' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.lucent.voice', -'Media', +'Mime', 'IANA', 'audio', 'vnd.lucent.voice' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.octel.sbc', -'Media', +'Mime', 'IANA', 'audio', 'vnd.octel.sbc' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.rhetorex.32kadpcm', -'Media', +'Mime', 'IANA', 'audio', 'vnd.rhetorex.32kadpcm' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.vmx.cvsd', -'Media', +'Mime', 'IANA', 'audio', 'vnd.vmx.cvsd' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.nortel.vbk', -'Media', +'Mime', 'IANA', 'audio', 'vnd.nortel.vbk' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.cns.anp1', -'Media', +'Mime', 'IANA', 'audio', 'vnd.cns.anp1' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.cns.inf1', -'Media', +'Mime', 'IANA', 'audio', 'vnd.cns.inf1' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/L16', -'Media', +'Mime', 'IANA', 'audio', 'L16' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.everad.plj', -'Media', +'Mime', 'IANA', 'audio', 'vnd.everad.plj' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/telephone-event', -'Media', +'Mime', 'IANA', 'audio', 'telephone-event' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/tone', -'Media', +'Mime', 'IANA', 'audio', 'tone' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/prs.sid', -'Media', +'Mime', 'IANA', 'audio', 'prs.sid' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.nuera.ecelp4800', -'Media', +'Mime', 'IANA', 'audio', 'vnd.nuera.ecelp4800' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.nuera.ecelp7470', -'Media', +'Mime', 'IANA', 'audio', 'vnd.nuera.ecelp7470' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/mpeg', -'Media', +'Mime', 'IANA', 'audio', 'mpeg' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/parityfec', -'Media', +'Mime', 'IANA', 'audio', 'parityfec' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/MP4A-LATM', -'Media', +'Mime', 'IANA', 'audio', 'MP4A-LATM' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.nuera.ecelp9600', -'Media', +'Mime', 'IANA', 'audio', 'vnd.nuera.ecelp9600' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/G.722.1', -'Media', +'Mime', 'IANA', 'audio', 'G.722.1' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/mpa-robust', -'Media', +'Mime', 'IANA', 'audio', 'mpa-robust' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/vnd.cisco.nse', -'Media', +'Mime', 'IANA', 'audio', 'vnd.cisco.nse' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/DAT12', -'Media', +'Mime', 'IANA', 'audio', 'DAT12' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/L20', -'Media', +'Mime', 'IANA', 'audio', 'L20' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'audio/L24', -'Media', +'Mime', 'IANA', 'audio', 'L24' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/mpeg', -'Media', +'Mime', 'IANA', 'video', 'mpeg' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/quicktime', -'Media', +'Mime', 'IANA', 'video', 'quicktime' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.vivo', -'Media', +'Mime', 'IANA', 'video', 'vnd.vivo' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.motorola.video', -'Media', +'Mime', 'IANA', 'video', 'vnd.motorola.video' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.motorola.videop', -'Media', +'Mime', 'IANA', 'video', 'vnd.motorola.videop' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.fvt', -'Media', +'Mime', 'IANA', 'video', 'vnd.fvt' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/pointer', -'Media', +'Mime', 'IANA', 'video', 'pointer' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/parityfec', -'Media', +'Mime', 'IANA', 'video', 'parityfec' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.mpegurl', -'Media', +'Mime', 'IANA', 'video', 'vnd.mpegurl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/MP4V-ES', -'Media', +'Mime', 'IANA', 'video', 'MP4V-ES' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'video/vnd.nokia.interleaved-multimedia', -'Media', +'Mime', 'IANA', 'video', 'vnd.nokia.interleaved-multimedia' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/iges', -'Media', +'Mime', 'IANA', 'model', 'iges' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vrml', -'Media', +'Mime', 'IANA', 'model', 'vrml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/mesh', -'Media', +'Mime', 'IANA', 'model', 'mesh' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.dwf', -'Media', +'Mime', 'IANA', 'model', 'vnd.dwf' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.gtw', -'Media', +'Mime', 'IANA', 'model', 'vnd.gtw' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.flatland.3dml', -'Media', +'Mime', 'IANA', 'model', 'vnd.flatland.3dml' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.vtu', -'Media', +'Mime', 'IANA', 'model', 'vnd.vtu' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.mts', -'Media', +'Mime', 'IANA', 'model', 'vnd.mts' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.gdl', -'Media', +'Mime', 'IANA', 'model', 'vnd.gdl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.gs-gdl', -'Media', +'Mime', 'IANA', 'model', 'vnd.gs-gdl' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.parasolid.transmit.text', -'Media', +'Mime', 'IANA', 'model', 'vnd.parasolid.transmit.text' ); -INSERT into media +INSERT into _mime ( -pgef_oid, -pgef_class, -owner_org_oid, -media_type, -media_subtype +_pgef_oid, +_onto_class, +_owner_org, +_media_type, +_media_subtype ) VALUES ( 'model/vnd.parasolid.transmit.binary', -'Media', +'Mime', 'IANA', 'model', 'vnd.parasolid.transmit.binary' ); - - - - - From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:46:17 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:46:19 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home added to the repository Message-ID: <200408090346.i793kHce018515@ned.gsfc.nasa.gov> Modified files: PanGalactic/home Log message: Directory /repo/step_testbed/PanGalactic/home added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:05 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:09 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/bin added to the repository Message-ID: <200408090350.i793o50A018563@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/bin Log message: Directory /repo/step_testbed/PanGalactic/home/bin added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:05 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:10 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/dict added to the repository Message-ID: <200408090350.i793o5ob018565@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/dict Log message: Directory /repo/step_testbed/PanGalactic/home/dict added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:06 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:10 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/logs added to the repository Message-ID: <200408090350.i793o6bw018569@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/logs Log message: Directory /repo/step_testbed/PanGalactic/home/logs added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:06 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:10 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/ontologies added to the repository Message-ID: <200408090350.i793o6iO018572@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/ontologies Log message: Directory /repo/step_testbed/PanGalactic/home/ontologies added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:06 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:11 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/ssl added to the repository Message-ID: <200408090350.i793o6on018577@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/ssl Log message: Directory /repo/step_testbed/PanGalactic/home/ssl added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:08 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:12 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/web added to the repository Message-ID: <200408090350.i793o7np018588@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/web Log message: Directory /repo/step_testbed/PanGalactic/home/web added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:50:08 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:50:12 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/vault added to the repository Message-ID: <200408090350.i793o7kn018583@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/vault Log message: Directory /repo/step_testbed/PanGalactic/home/vault added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:51:30 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:51:32 2004 Subject: [Pangalactic-commits] Add pgerd init script. Message-ID: <200408090351.i793pU51018665@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/bin/pgerd None 1.1 Log message: Add pgerd init script. From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:52:48 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:52:49 2004 Subject: [Pangalactic-commits] Add words for vetting passwds (not implemented yet). Message-ID: <200408090352.i793qmMX018704@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/dict/testwords None 1.1 Log message: Add words for vetting passwds (not implemented yet). From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:53:28 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:53:31 2004 Subject: [Pangalactic-commits] Directory /repo/step_testbed/PanGalactic/home/logs/archive added to the repository Message-ID: <200408090353.i793rS2J018728@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/logs/archive Log message: Directory /repo/step_testbed/PanGalactic/home/logs/archive added to the repository From waterbug at ned.gsfc.nasa.gov Sun Aug 8 23:57:11 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 8 23:57:13 2004 Subject: [Pangalactic-commits] Add README for home/logs/archive. Message-ID: <200408090357.i793vBdd018773@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/logs/archive/README None 1.1 Log message: Add README for home/logs/archive. From waterbug at ned.gsfc.nasa.gov Mon Aug 9 00:00:14 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 00:00:15 2004 Subject: [Pangalactic-commits] Add some std ontologies. Message-ID: <200408090400.i7940E8Q018822@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/ontologies/dces.rdf None 1.1 PanGalactic/home/ontologies/dcq.rdf None 1.1 PanGalactic/home/ontologies/dctype.rdf None 1.1 PanGalactic/home/ontologies/foaf.owl None 1.1 PanGalactic/home/ontologies/pgef.owl None 1.1 Log message: Add some std ontologies. From waterbug at ned.gsfc.nasa.gov Mon Aug 9 00:01:46 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 00:01:48 2004 Subject: [Pangalactic-commits] Add README for ssl dir. Message-ID: <200408090401.i7941kGt018862@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/ssl/README None 1.1 Log message: Add README for ssl dir. From waterbug at ned.gsfc.nasa.gov Mon Aug 9 00:05:44 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 00:05:45 2004 Subject: [Pangalactic-commits] Add README for home/web dir. Message-ID: <200408090405.i7945il0018921@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/web/README None 1.1 Log message: Add README for home/web dir. From waterbug at ned.gsfc.nasa.gov Mon Aug 9 00:07:12 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 00:07:12 2004 Subject: [Pangalactic-commits] Add README for vault. Message-ID: <200408090407.i7947CQE018959@ned.gsfc.nasa.gov> Modified files: PanGalactic/home/vault/README None 1.1 Log message: Add README for vault. From waterbug at ned.gsfc.nasa.gov Mon Aug 9 11:11:15 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 11:11:18 2004 Subject: [Pangalactic-commits] NARS refs removed and imports prettied up. Message-ID: <200408091511.i79FBFWf024081@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/datamanager.py 1.129 1.130 Log message: NARS refs removed and imports prettied up. Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.129 PanGalactic/pangalactic/utils/datamanager.py:1.130 --- PanGalactic/pangalactic/utils/datamanager.py:1.129 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 9 11:11:14 2004 @@ -1,7 +1,12 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/utils/datamanager.py,v $ -__version__ = "$Revision: 1.129 $"[11:-2] +""" +Manager of all data transactions for PanGalaxian. +@version: $Revision: 1.130 $ +""" + +__version__ = "$Revision: 1.130 $"[11:-2] import time import mx.DateTime @@ -13,50 +18,32 @@ import xmlrpclib import mimetypes -from twisted.python import components - -from pangalactic.utils.xmlrpcinterface import XmlrpcInterface -from pangalactic.utils.pgefexceptions import LocalStorageError -from pangalactic.utils import preferences -from pangalactic.utils.httpupload import upload - -import pangalactic.utils.objectstatus as objectstatus - -import pangalactic.meta.ontoclass -import pangalactic.meta.ontoproperty +import ZODB +from ZODB import FileStorage, DB +from ZODB import * -from pangalactic.enterprise.acu import Acu -from pangalactic.enterprise.dcu import Dcu -from pangalactic.enterprise.pgefrole import PgefRole +# PanGalactic imports +from pangalactic.enterprise.document import Document +from pangalactic.enterprise.model import Model +from pangalactic.enterprise.part import Part from pangalactic.enterprise.person import Person +from pangalactic.enterprise.pgefrole import PgefRole from pangalactic.enterprise.project import Project -from pangalactic.enterprise.document import Document from pangalactic.enterprise.partslist import PartsList from pangalactic.enterprise.pgeffile import PgefFile +from pangalactic.enterprise.workflow import wffactory +from pangalactic.utils import preferences +from pangalactic.utils import localdb +from pangalactic.utils import objectstatus +from pangalactic.utils.httpupload import upload +from pangalactic.utils.pgefexceptions import LocalStorageError +from pangalactic.utils.xmlrpcinterface import XmlrpcInterface -import pangalactic.enterprise.part as part -import pangalactic.enterprise.model as model - -import pangalactic.enterprise.workflow.wffactory as wffactory -import pangalactic.enterprise.workflow.wfentity -import pangalactic.enterprise.workflow.wfprocessinstance -import pangalactic.enterprise.workflow.wfactivity -import pangalactic.enterprise.workflow.wfeventaudit -import pangalactic.enterprise.workflow.wftransition - -import ZODB -from ZODB import FileStorage, DB -from ZODB import * - -import pangalactic.utils.localdb as localdb - -# from nars.enterprise.pgefadvisory import PgefAdvisory -RSN_CLASSES = ["GidepAgencyActionNotice", - "GidepProductChangeNotice", - "GidepDmsmsNotice"] class DataManager: - """Class that manages all of the data transactions""" + """ + Manager of all data transactions for PanGalaxian. + """ def __init__(self, parent, currentprojectname=None, clearcache=None, domains='PanGalactic'): @@ -191,13 +178,12 @@ #print "dm.newobject" obj = None if classname == "Part": - obj = part.Part(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject.id, - _project = self.CurrentProject) + obj = Part(id = "NEW", + id_context = self.CurrentProject.id_context, + project = self.CurrentProject) obj.initObject(self.CurrentProject.id, self.user.id) elif classname == "Model": - obj = model.Model(id = "NEW", + obj = Model(id = "NEW", id_context = self.CurrentProject.id_context, project = self.CurrentProject.id, _project = self.CurrentProject) @@ -789,17 +775,6 @@ self.searchresults = objdict.values() - def searchAlerts(self, classattrdict): - #print "datamanager.searchAlerts", classattrdict - objs_to_hookup = self.localDB.getCommittedObjects() - try: - self.searchresults = self.server.searchAlerts(classattrdict, objs_to_hookup) - #print "# results", len(self.searchresults) - except: - print "dm.search.xmlrpc.error" - return [] - - def getSearchResults(self): #print "datamanager.getsearchresults" if self.searchresults: @@ -1008,28 +983,6 @@ return objdict.values() -# def getUncommittedAlerts(self): -# uncommobjs = self.localDB.getUncommittedAlerts() -# return uncommobjs -# -# def uncommittedAlerts(self): -# #print "uncommittedalerts" -# -# uncommobjs = self.localDB.getUncommittedAlerts() -# objlen = len(uncommobjs) -# if objlen > 0: -# for obj in uncommobjs: -# # print "obj", obj.id -# if isinstance(obj, PgefAdvisory): -# # print "true" -# return True -# # print "false1" -# return False -# else: -# # print "false2" -# return False - - def translateAttrinfo(self, attrinfo): #print "dm.translateattrinfo", attrinfo if attrinfo[1] == "IS NOT": @@ -1049,49 +1002,6 @@ return (server_info, local_info) - def getAlerts(self, attrlist, uncommitted_flag = False): - #print "dm.getalerts", attrlist - classnames = localdb.NARS_CLASSES - - local_attrlist = [] - server_attrlist = [] - # temporary cleanup of attrlist - if attrlist: - # translate any criteria to python/sql specific syntax - for attrinfo in attrlist: - #print "attrinfo", attrinfo - trans_info = self.translateAttrinfo(attrinfo) - server_attrlist.append(trans_info[0]) - local_attrlist.append(trans_info[1]) - - #print "server_attrlist", server_attrlist - #print "local_attrlist", local_attrlist - - local_objs = self.localDB.getAlerts(local_attrlist, uncommitted_flag).values() - - #print "dm.getalerts.local_objs", local_objs - if self.user._loggedin: - #print "logged in" - classattrdict = {} - for classname in classnames: - #print "dm.getalerts.seeking", classname, "for", server_attrlist - if classname not in RSN_CLASSES and len(server_attrlist) > 0: - classattrdict[classname] = server_attrlist - #print "classattrdict", classattrdict - try: - searchresults = self.server.searchAlerts(classattrdict, local_objs) - #print "dm.getalerts.nresults", len(searchresults) - #print "dm.getalerts.searchresults", searchresults - except: - print "dm.getalerts.xmlrpc.error" - return [] - self.save(searchresults) - return searchresults - else: - #print "not logged in", local_attrlist - return local_objs - - def getFiles(self, obj_list): #print "dm.getfiles", obj_list @@ -1120,85 +1030,6 @@ else: #print "search localdb" return local_files - - -# def getAlertsByCoordinator(self, userid): -# print "datamanager.getalertsbycoordinator : tbd" -# alertlist = [] -# return alertlist - - - def commitAlerts(self, unsavedobjs = None): - print "datamanager.commitalerts" - alertaddlist = [] - alertdellist = [] - fileaddlist = [] - genfilelist = [] - - if not unsavedobjs: - unsavedobjs = self.localDB.getUncommittedAlerts() - timetuple = mx.DateTime.now() - newtime = timetuple.strftime("%m/%d/%Y %H:%M:%S") - retval = None - - if self.user._loggedin: - if len(unsavedobjs) > 0: - for obj in unsavedobjs: - #print "checking", obj.id - if obj.state == objectstatus.DELETE: - alertdellist.append(obj) - - elif obj.state == objectstatus.MODIFY: - if obj.__class__.__name__ != "PgefFile": - alertaddlist.append(obj) - else: #if obj.__class__.__name__ == "PgefFile": - fileaddlist.append(obj) - - elif obj.state == objectstatus.ADD: - if obj.__class__.__name__ != "PgefFile": - alertaddlist.append(obj) - else: #if obj.__class__.__name__ == "PgefFile": - fileaddlist.append(obj) - - print "setting is_head = True for", obj.__class__.__name__, obj.id - obj.is_head = True - actionlist = [] - - print "alertaddlist:", alertaddlist - print "fileaddlist:", fileaddlist - if len(alertaddlist) > 0: - alertsadded = self.server.addObjects(alertaddlist) - if alertsadded: - print "alert add succeeded" - if len(fileaddlist) > 0: - alertfilesadded = self.server.addObjects(fileaddlist) - if alertfilesadded: - print "alert files add succeeded" - for obj in alertaddlist: - obj.state = None - actionlist.append(obj) - for obj in fileaddlist: - obj.state = None - actionlist.append(obj) - self.uploadFile(obj) - else: - print "commit alerts failed" - - if len(alertdellist) > 0: - # do we ever delete? - pass - - # reset the status flags for the committed objects - self.localDB.save(actionlist, override = True) - self.localDB.ClearUncommittedObjects(actionlist) - else: - self.localDB.add(unsavedobjs) - - self.Refresh = False - if retval: - return retval - else: - return newtime def commitWfObjs(self, unsavedobjs = None): From waterbug at ned.gsfc.nasa.gov Mon Aug 9 12:48:51 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 12:48:53 2004 Subject: [Pangalactic-commits] Use the Registry, Luke! ;) Message-ID: <200408091648.i79Gmpil025496@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/datamanager.py 1.130 1.131 Log message: Use the Registry, Luke! ;) Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.130 PanGalactic/pangalactic/utils/datamanager.py:1.131 --- PanGalactic/pangalactic/utils/datamanager.py:1.130 Mon Aug 9 11:11:14 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 9 12:48:49 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.130 $ +@version: $Revision: 1.131 $ """ -__version__ = "$Revision: 1.130 $"[11:-2] +__version__ = "$Revision: 1.131 $"[11:-2] import time import mx.DateTime @@ -23,15 +23,12 @@ from ZODB import * # PanGalactic imports -from pangalactic.enterprise.document import Document -from pangalactic.enterprise.model import Model -from pangalactic.enterprise.part import Part from pangalactic.enterprise.person import Person from pangalactic.enterprise.pgefrole import PgefRole from pangalactic.enterprise.project import Project -from pangalactic.enterprise.partslist import PartsList from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.enterprise.workflow import wffactory +from pangalactic.meta.registry import PanGalacticRegistry from pangalactic.utils import preferences from pangalactic.utils import localdb from pangalactic.utils import objectstatus @@ -45,11 +42,13 @@ Manager of all data transactions for PanGalaxian. """ def __init__(self, parent, currentprojectname=None, - clearcache=None, domains='PanGalactic'): + clearcache=None, domains='PanGalactic', + pgregistry=None): self.initLocalDB(clearcache) self.parent = parent self.domains = domains + self._registry = pgregistry or PanGalacticRegistry() self.user = Person(_loggedin = False) self.auth = None self.serverName = "localhost" @@ -67,9 +66,7 @@ self.partsListIDs = {} self.documentIDs = {} self.pdrIDs = {} - self.topLevelItemIDs = [] - self.creatingItem = False self.creatingPartsList = False self.creatingDocument = False @@ -120,7 +117,7 @@ def getPasswd(self, pwd_id): return self.localDB.getPasswd(pwd_id) - def changePassword(self, login_pwd, new_pwd, userid = "", secure=1): + def changePassword(self, login_pwd, new_pwd, userid="", secure=1): #print "update local passwds" self.server.changePassword(new_pwd, userid) if userid == self.user.id: @@ -148,6 +145,7 @@ print "dm.getdisplaymap: no entry for:", mapname, "wha' happened?" return {} + def getDisplayConfig(self): return self.localDB.getDisplayConfig() @@ -175,41 +173,21 @@ self.localDB.SaveUser(user) def newObject(self, classname): + """ + Create a new object with the current project as its 'project' + attribute. + """ #print "dm.newobject" + if classname == "PgefFile": + e = "PgefFile should not be initialized here. Use newPgefFile." + raise ValueError, e obj = None - if classname == "Part": - obj = Part(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject) - obj.initObject(self.CurrentProject.id, self.user.id) - elif classname == "Model": - obj = Model(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject.id, - _project = self.CurrentProject) - obj.initObject(self.CurrentProject.id, self.user.id) - elif classname == "Document": - obj = Document(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject.id, - _project = self.CurrentProject) - obj.initObject(self.CurrentProject.id, self.user.id) - obj._local_file_name = None - elif classname == "PartsList": - obj = PartsList(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject.id, - _project = self.CurrentProject) - obj.initObject(self.CurrentProject.id, self.user.id) - obj._local_file_name = None - elif classname == "DocPtRel": - obj = DocPtRel(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject.id, - _project = self.CurrentProject) + if classname in ["Part", "Model", "Document", "PartsList"]: + klass = self._registry.pgef_classes[classname] + obj = klass(id = "NEW", + id_context = self.CurrentProject.id_context, + project = self.CurrentProject) obj.initObject(self.CurrentProject.id, self.user.id) - elif classname == "PgefFile": - print "PgefFile should not be initialized here. Use newPgefFile." return obj From waterbug at ned.gsfc.nasa.gov Mon Aug 9 14:18:20 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 14:18:25 2004 Subject: [Pangalactic-commits] DataManager's xmlrpc interface gets a reference to _registry. Message-ID: <200408091818.i79IIKaR027539@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/IDTEST 1.50 1.51 PanGalactic/pangalactic/utils/datamanager.py 1.131 1.132 PanGalactic/pangalactic/utils/xmlrpcinterface.py 1.66 1.67 Log message: DataManager's xmlrpc interface gets a reference to _registry. Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.131 PanGalactic/pangalactic/utils/datamanager.py:1.132 --- PanGalactic/pangalactic/utils/datamanager.py:1.131 Mon Aug 9 12:48:49 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 9 14:18:18 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.131 $ +@version: $Revision: 1.132 $ """ -__version__ = "$Revision: 1.131 $"[11:-2] +__version__ = "$Revision: 1.132 $"[11:-2] import time import mx.DateTime @@ -43,12 +43,12 @@ """ def __init__(self, parent, currentprojectname=None, clearcache=None, domains='PanGalactic', - pgregistry=None): + _registry=None): self.initLocalDB(clearcache) self.parent = parent self.domains = domains - self._registry = pgregistry or PanGalacticRegistry() + self._registry = _registry or PanGalacticRegistry() self.user = Person(_loggedin = False) self.auth = None self.serverName = "localhost" @@ -92,7 +92,8 @@ username, password, secure=secure, - domains=self.domains) + domains=self.domains, + _registry=self._registry) def initLocalDB(self, clearcache): @@ -221,6 +222,10 @@ def setCurrentProject(self, projectname): + """ + Set the current project context, which will be used for all new + objects that have a 'project' attribute. + """ #print "datamanager.setcurrentproject", projectname self.CurrentProject = None allprojects = self.localDB.getDict(self.localDB.PROJECT) @@ -232,7 +237,11 @@ print "Aha. Project", self.CurrentProject.id else: print "Rats! No Project. Faking it." - self.CurrentProject = Project() + # might as well make it the official "null" project ... + self.CurrentProject = Project(pgef_oid='NOPROJECT', + id='NOPROJECT', + name='Ni', + description='No project specified') def login(self, username, password, secure=1): @@ -288,7 +297,9 @@ def getItemsByProject(self, projectlist): - """Retrieves the items associated with a project""" + """ + Retrieves the items associated with a project + """ print "datamanager.getitemsbyproject" tempobjlist = [] tempids = {} @@ -305,24 +316,26 @@ print "NOTE: user is smallberries for testing" fieldnames = {"owner" : "smallberries"} #self.user.id} # testing only - remove RSN docs = self.server.getObjects("Document", - fields = fieldnames, - refs = 0, subtypes = 0, - objs = None) + fields=fieldnames, + refs=0, + subtypes=0, + objs=None) #print "docs", docs # do we need to connect docs with parts/models? fieldnames = {"project" : projectlist[0]} parts = self.server.getObjects("Part", - fields = fieldnames, - refs = 1, subtypes = 0, - objs = None) + fields=fieldnames, + refs=0, + subtypes=0, + objs=None) #print "parts", parts objs = self.server.getObjects("Model", - fields = fieldnames, - refs = 1, subtypes = 0, - objs = parts) + fields=fieldnames, + refs=0, + subtypes=0, + objs=None) #print "obj", objs - #print "\n" except Exception, e: print "no items in project" Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.50 PanGalactic/pangalactic/test/IDTEST:1.51 --- PanGalactic/pangalactic/test/IDTEST:1.50 Sun Aug 8 21:48:49 2004 +++ PanGalactic/pangalactic/test/IDTEST Mon Aug 9 14:18:18 2004 @@ -1 +1 @@ -826 \ No newline at end of file +836 \ No newline at end of file Index: PanGalactic/pangalactic/utils/xmlrpcinterface.py diff -u PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.66 PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.67 --- PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.66 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/xmlrpcinterface.py Mon Aug 9 14:18:18 2004 @@ -3,10 +3,10 @@ """ PanGalactic Client XML-RPC Interfaces -@version: $Revision: 1.66 $ +@version: $Revision: 1.67 $ """ -__version__ = "$Revision: 1.66 $"[11:-2] +__version__ = "$Revision: 1.67 $"[11:-2] import xmlrpclib import types @@ -116,10 +116,11 @@ """ def __init__(self, host, port, username='', password='', - secure=1, domains='PanGalactic'): + secure=1, domains='PanGalactic', _registry=None): # proxyhost=None, proxyport=None ... # (we'll worry about proxies later :) - self._factory = PanGalacticFactory(domains=domains) + self._factory = PanGalacticFactory(_registry=_registry, + domains=domains) if secure: # not tested, according to xmlrpclib docs conns = 'https://' From waterbug at ned.gsfc.nasa.gov Mon Aug 9 14:37:11 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 14:37:13 2004 Subject: [Pangalactic-commits] head_flag -> is_head Message-ID: <200408091837.i79IbBt3027777@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/itemsearchform.py 1.26 1.27 PanGalactic/pangalactic/repo/pger.py 1.85 1.86 PanGalactic/pangalactic/utils/xmlrpcinterface.py 1.67 1.68 Log message: head_flag -> is_head Index: PanGalactic/pangalactic/repo/pger.py diff -u PanGalactic/pangalactic/repo/pger.py:1.85 PanGalactic/pangalactic/repo/pger.py:1.86 --- PanGalactic/pangalactic/repo/pger.py:1.85 Sun Aug 8 22:22:57 2004 +++ PanGalactic/pangalactic/repo/pger.py Mon Aug 9 14:37:09 2004 @@ -1,10 +1,10 @@ -# $Id: pger.py,v 1.85 2004/08/09 02:22:57 waterbug Exp $ +# $Id: pger.py,v 1.86 2004/08/09 18:37:09 waterbug Exp $ """ Pan Galactic Entropy Reverser module -@version: $Revision: 1.85 $ +@version: $Revision: 1.86 $ """ -__version__ = "$Revision: 1.85 $"[11:-2] +__version__ = "$Revision: 1.86 $"[11:-2] import sys import os @@ -324,12 +324,12 @@ Add an extract of a VersionedObject to PGER - usage: addVersionExtract(requestor, VersionedObject extract) - procedure: - - get the iteration of the current head (head_flag=True) for + - get the iteration of the current head (is_head=True) for that base_id - set the iteration of the extract to the incremented iteration of the current head - call PgerDb.addObjects - - set the head_flag to False for all versions currently in + - set the is_head to False for all versions currently in the repository for that base_id - return an extract - NOTE: any application objects referenced as an attribute of) @@ -348,7 +348,7 @@ log.msg(logmsg, system='%s:PGER' % requestor) res = self.infum.getObjects(ocid, base_id=e['base_id'], - head_flag=True) + is_head=True) res.addCallbacks(lambda x: x[0].iteration, self.addVersionExtractError) # res.addCallbacks(, @@ -359,7 +359,7 @@ def _setHeadFlags(self, requestor, extracts): """ For a list of extracts of newly-added VersionedObjects, set the - head_flag's of all other versions with the same base_id to False. + is_head's of all other versions with the same base_id to False. - usage: _setHeadFlags(list of VersionedObject extracts) @@ -375,7 +375,7 @@ d = self.infum.updateObjects( requestor, e['onto_class'], - updates={'head_flag': False}, + updates={'is_head': False}, where=[['base_id', '=', e['base_id']], ['pgef_oid', '!=', e['pgef_oid']]]) return extracts Index: PanGalactic/pangalactic/utils/xmlrpcinterface.py diff -u PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.67 PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.68 --- PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.67 Mon Aug 9 14:18:18 2004 +++ PanGalactic/pangalactic/utils/xmlrpcinterface.py Mon Aug 9 14:37:09 2004 @@ -3,10 +3,10 @@ """ PanGalactic Client XML-RPC Interfaces -@version: $Revision: 1.67 $ +@version: $Revision: 1.68 $ """ -__version__ = "$Revision: 1.67 $"[11:-2] +__version__ = "$Revision: 1.68 $"[11:-2] import xmlrpclib import types @@ -188,7 +188,7 @@ def getObjects(self, classname, fields, refs=0, subtypes=0, - objs=None, head_flag=1): + objs=None, is_head=True): """ Retrieve the objects that have the field-value pairs in fieldvaluedict. @@ -212,9 +212,9 @@ """ #print "xmlrpc.getobjects" # get only the latest version for versioned objects, if requested - if head_flag: + if is_head: if classname in ["Part", "Document", "Model", "OntoClass", "PartsList"]: - fields["head_flag"] = head_flag + fields["is_head"] = True if objs == None: objs = [] Index: PanGalactic/pangalactic/client/modules/psm/itemsearchform.py diff -u PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.26 PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.27 --- PanGalactic/pangalactic/client/modules/psm/itemsearchform.py:1.26 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemsearchform.py Mon Aug 9 14:37:09 2004 @@ -209,9 +209,9 @@ # only apply it if there is some other criterion selected field = self.GetVersionRadioWgt().GetSelection() if field == 1: - head_flag = 0 + is_head = False else: - head_flag = 1 + is_head = True for classname in classnames: classattrdict[classname] = [] @@ -232,8 +232,8 @@ print "checklist", checklist for classname, fields in classattrdict.items(): if len(fields) > 0: - if head_flag: - classattrdict[classname].append(("head_flag", "boolean", head_flag)) + if is_head: + classattrdict[classname].append(("is_head", "boolean", is_head)) if not checklist[classname]: del classattrdict[classname] else: From waterbug at ned.gsfc.nasa.gov Mon Aug 9 17:55:35 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 9 17:55:39 2004 Subject: [Pangalactic-commits] Removed circular dependency between DataManager and Security Manager Message-ID: <200408092155.i79LtZcG029894@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.106 1.107 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.20 1.21 PanGalactic/pangalactic/client/modules/psm/docform.py 1.4 1.5 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.35 1.36 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.142 1.143 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.9 1.10 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.24 1.25 PanGalactic/pangalactic/client/modules/psm/partform.py 1.9 1.10 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.33 1.34 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.33 1.34 PanGalactic/pangalactic/utils/datamanager.py 1.132 1.133 PanGalactic/pangalactic/utils/preferences.py 1.3 1.4 PanGalactic/pangalactic/utils/securitymanager.py 1.9 1.10 PanGalactic/src/sql/insertRefData.sql 1.11 1.12 Log message: Removed circular dependency between DataManager and Security Manager .. and other ugly and/or hideous things. Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.33 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.34 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.33 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Mon Aug 9 17:55:33 2004 @@ -25,7 +25,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.33 $"[11:-2] +__version__ = "$Revision: 1.34 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -329,7 +329,7 @@ def DiscardChanges(self): if self.creatingDocument: - docid = preferences.GetPreference('nextplid') + docid = preferences.prefs.get('nextplid', '1') docid = int(docid) - 1 preferences.prefs['nextplid'] = docid preferences.CreatePreferencesFile(preferences.prefs) Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.33 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.34 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.33 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Mon Aug 9 17:55:33 2004 @@ -6,7 +6,7 @@ #import pangalactic.enterprise.partslist as partslist #import dataobjects.item -import pangalactic.utils.preferences as preferences +from pangalactic.utils import preferences from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions @@ -27,11 +27,7 @@ self.ColumnInfo = None self.ColumnMapping = None - temp = preferences.GetPreference('nextplid') - if temp: - self.NextDocId = temp - else: - self.NextDocId = 0 + self.NextDocId = preferences.prefs.get('nextplid', 0) preferences.prefs['nextplid'] = self.NextDocId PartsListFunc(self, True) Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.142 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.143 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.142 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Mon Aug 9 17:55:33 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.142 $"[11:-2] +__version__ = "$Revision: 1.143 $"[11:-2] import copy import types @@ -31,16 +31,12 @@ from pangalactic.client.modules.psm import pgefversiontree +from pangalactic.utils import objectstatus from pangalactic.utils import preferences from pangalactic.utils import toolframe - from pangalactic.utils.pgefexceptions import RequiredDataError - from pangalactic.utils.securitymanager import actions as security_actions -import pangalactic.utils.objectstatus as objectstatus -import pangalactic.utils.preferences - try: from pangalactic.client.modules.plm.plmtool import * except: @@ -1244,14 +1240,14 @@ def DiscardChanges(self): if self.dm.creatingPartsList: - plid = preferences.GetPreference('nextplid') + plid = preferences.prefs.get('nextplid', 1) plid = int(plid) - 1 preferences.prefs['nextplid'] = plid preferences.CreatePreferencesFile(preferences.prefs) self.partslistform.NextDocId = str(int(self.partslistform.NextDocId) - 1) if self.dm.creatingDocument: - docid = preferences.GetPreference('nextdocid') + docid = preferences.prefs.get('nextdocid', 1) docid = int(docid) - 1 preferences.prefs['nextdocid'] = docid preferences.CreatePreferencesFile(preferences.prefs) Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.35 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.36 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.35 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Mon Aug 9 17:55:33 2004 @@ -5,19 +5,19 @@ import copy import types -import pangalactic.client.modules.psm.docform as docform -import pangalactic.client.modules.psm.pgefdoctree as pgefdoctree -import pangalactic.client.modules.psm.doctreeframe as doctreeframe +from pangalactic.client.modules.psm import docform +from pangalactic.client.modules.psm import pgefdoctree +from pangalactic.client.modules.psm import doctreeframe from pangalactic.enterprise.document import Document #from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError -import pangalactic.utils.objectstatus as objectstatus -import pangalactic.utils.preferences as preferences +from pangalactic.utils import objectstatus +from pangalactic.utils import preferences -__version__ = "$Revision: 1.35 $"[11:-2] +__version__ = "$Revision: 1.36 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -216,7 +216,7 @@ def DiscardChanges(self): if self.creatingDocument: - docid = preferences.GetPreference('nextdocid') + docid = preferences.prefs.get('nextdocid', 0) docid = int(docid) - 1 preferences.prefs['nextdocid'] = docid preferences.CreatePreferencesFile(preferences.prefs) Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.11 PanGalactic/src/sql/insertRefData.sql:1.12 --- PanGalactic/src/sql/insertRefData.sql:1.11 Sun Aug 8 23:28:07 2004 +++ PanGalactic/src/sql/insertRefData.sql Mon Aug 9 17:55:33 2004 @@ -1,6 +1,6 @@ /* PGERDB reference data initialization. */ -/* $Id: insertRefData.sql,v 1.11 2004/08/09 03:28:07 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.12 2004/08/09 21:55:33 waterbug Exp $ */ /* This script sets up the default identification contexts for * PGEF objects, and is required before the PGERDB can be @@ -50,6 +50,27 @@ 'admin', 'admin', 'TO1', + '0' +); + +INSERT INTO _person +( + _pgef_oid, + _id, + _id_context, + _pger_owner, + _pger_creator, + _org, + _god +) +VALUES +( + 'newbie', + 'newbie', + 'PGER', + 'admin', + 'admin', + 'FGII', '0' ); Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.106 PanGalactic/pangalactic/client/fnord.py:1.107 --- PanGalactic/pangalactic/client/fnord.py:1.106 Sun Aug 8 22:53:44 2004 +++ PanGalactic/pangalactic/client/fnord.py Mon Aug 9 17:55:32 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.106 2004/08/09 02:53:44 waterbug Exp $ +# $Id: fnord.py,v 1.107 2004/08/09 21:55:32 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.106 $ +@version: $Revision: 1.107 $ """ -__version__ = "$Revision: 1.106 $"[11:-2] +__version__ = "$Revision: 1.107 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -15,24 +15,23 @@ import sys, os, time +from pangalactic.enterprise.person import Person +from pangalactic.utils import oid +from pangalactic.utils import dbbrowser +from pangalactic.utils import preferences +from pangalactic.utils import toolstate +from pangalactic.utils import toolframe +from pangalactic.utils import ToolkitImages +from pangalactic.utils import userinfo from pangalactic.utils.loginform_wdr import * from pangalactic.utils.loginclass import * from pangalactic.utils.proxyclass import * from pangalactic.utils.serverclass import * from pangalactic.utils.aboutbox import AboutBox from pangalactic.utils.changepasswd import ChangePasswd - -import pangalactic.utils.userinfo as userinfo +from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.usersearchframe import UserSearchFrame -from pangalactic.utils import oid -from pangalactic.utils import dbbrowser -from pangalactic.utils import securitymanager -from pangalactic.utils import preferences -from pangalactic.utils import toolstate -from pangalactic.utils import toolframe -from pangalactic.utils import ToolkitImages - from pangalactic.utils.datamanager import DataManager # this is bogus -- should be hidden inside DM ... from pangalactic.utils.datamanager import LocalStorageError @@ -114,6 +113,7 @@ PRODUCT_TYPES = {ID_FILE_NEWPART : "Part", ID_FILE_NEWMODEL : "Model"} +prefs = preferences.prefs class CustomStatusBar(wxStatusBar): """ This method created the statusbar that is used on the main form """ @@ -205,11 +205,6 @@ self.sb = CustomStatusBar(self) self.SetStatusBar(self.sb) - preferences.LoadPreferences(1) - self.State.currentprojectname = preferences.GetPreference('lastproject') - self.dm = DataManager(self, currentprojectname = self.State.currentprojectname) - self.WatchDog = securitymanager.SecurityManager(self.dm) - self.AppTitle = "PGEF" self.BuildDate = BUILD_DATE self.Version = VERSION @@ -255,12 +250,12 @@ EVT_MENU(self, ID_ADMIN_ADDUSER, self.onAdminAddUser) EVT_MENU(self, ID_ADMIN_SEARCHUSER, self.onAdminSearchUser) - showloginconfirm = preferences.GetPreference('ShowLoginConfirmation') - if showloginconfirm == None: - showloginconfirm = True + preferences.LoadPreferences(1) + + showloginconfirm = prefs.get('ShowLoginConfirmation', True) self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, int(showloginconfirm)) - if not preferences.GetPreference('userid'): + if not prefs.get('userid', None): dlg = wxDialog(self, -1, "Required information missing", size=wxSize(350, 200), style=wxCAPTION) sizer = wxBoxSizer(wxVERTICAL) @@ -289,21 +284,26 @@ dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - preferences.prefs['userid'] = username.GetValue() - preferences.prefs['email'] = email.GetValue() + prefs['userid'] = username.GetValue() + prefs['email'] = email.GetValue() - preferences.CreatePreferencesFile(preferences.prefs) + preferences.CreatePreferencesFile(prefs) dlg.Destroy() - else: - self.dm.user.id = preferences.GetPreference('userid') - - email = preferences.GetPreference('email') + + self.user = Person(pgef_oid=prefs['userid'], + id=prefs['userid'], + email=prefs['email']) + self.State.currentprojectname = prefs.get('lastproject', None) + self.WatchDog = SecurityManager(self.user) + self.dm = DataManager(self.WatchDog, + currentprojectname=self.State.currentprojectname) + email = prefs.get('email', None) oid.setOidBase(email) self.ActivateTool() self.OnServerCombo() - show_tooltips = preferences.GetPreference("ShowToolTips") + show_tooltips = prefs.get("ShowToolTips", None) if show_tooltips == "True": wxToolTip_Enable(True) self.menuBar.Check(ID_PREF_TOOLTIPS, True) @@ -503,33 +503,33 @@ checked = self.menuBar.FindItemById(id).IsChecked() if checked: wxToolTip_Enable(True) - preferences.prefs["ShowToolTips"] = True + prefs["ShowToolTips"] = True else: wxToolTip_Enable(False) - preferences.prefs["ShowToolTips"] = False - preferences.CreatePreferencesFile(preferences.prefs) + prefs["ShowToolTips"] = False + preferences.CreatePreferencesFile(prefs) event.Skip() def OnLoginConfirmed(self, event): id = event.GetId() checked = self.menuBar.FindItemById(id).IsChecked() if checked: - preferences.prefs['ShowLoginConfirmation'] = True + prefs['ShowLoginConfirmation'] = True else: - preferences.prefs['ShowLoginConfirmation'] = False - preferences.CreatePreferencesFile(preferences.prefs) + prefs['ShowLoginConfirmation'] = False + preferences.CreatePreferencesFile(prefs) def OnSetUserId(self, event): - user = preferences.GetPreference('userid') + user = prefs.get('userid', None) if user: dlg = wxTextEntryDialog(self, 'Set locally stored userid to?', 'Setup UserId', user) else: dlg = wxTextEntryDialog(self, 'Set locally stored userid to?', 'Setup UserId', 'Unknown') dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - preferences.prefs['userid'] = dlg.GetValue() - preferences.CreatePreferencesFile(preferences.prefs) + prefs['userid'] = dlg.GetValue() + preferences.CreatePreferencesFile(prefs) dlg.Destroy() @@ -705,20 +705,20 @@ def OnSetOutputDir(self, event): - outdir = preferences.GetPreference('outputdir') + outdir = prefs.get('outputdir', None) if outdir: dlg = wxTextEntryDialog(self, 'Set output directory?', 'Set OutputDir', outdir) else: dlg = wxTextEntryDialog(self, 'Set output directory?', 'Set OutputDir', '') dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - preferences.prefs['outputdir'] = dlg.GetValue() - preferences.CreatePreferencesFile(preferences.prefs) + prefs['outputdir'] = dlg.GetValue() + preferences.CreatePreferencesFile(prefs) dlg.Destroy() def OnProxySettings(self, event): dlg = ProxyDialog(self, -1, 'Enter Proxy Information') - proxy = preferences.GetPreference('proxy') + proxy = prefs.get('proxy', None) if proxy: proxyname, proxyport = proxy.split(':') dlg.GetTextctrlServer().SetValue(proxyname) @@ -737,12 +737,12 @@ errdlg.CentreOnParent() errdlg.ShowModal() else: - preferences.prefs['proxy'] = server + ':' + port - preferences.CreatePreferencesFile(preferences.prefs) + prefs['proxy'] = server + ':' + port + preferences.CreatePreferencesFile(prefs) def OnServerSettings(self, event): dlg = ServerDialog(self, -1, 'Enter Server Information') - server = preferences.GetPreference('server') + server = prefs.get('server', None) if server: servername, serverport = server.split(':') else: @@ -764,8 +764,8 @@ errdlg.CentreOnParent() errdlg.ShowModal() else: - preferences.prefs['server'] = server + ':' + port - preferences.CreatePreferencesFile(preferences.prefs) + prefs['server'] = server + ':' + port + preferences.CreatePreferencesFile(prefs) self.dm.serverName = server self.dm.serverPort = port @@ -920,7 +920,7 @@ def OnLogin(self, event): #print "fnord.onlogin" - loginconfirm = preferences.GetPreference('ShowLoginConfirmation') + loginconfirm = prefs.get('ShowLoginConfirmation', None) dialog = LoginClass(self, -1, "PGEF Login" ) if loginconfirm == None: loginconfirm = True @@ -935,7 +935,7 @@ dialog.GetRepository().SetSelection(0) dialog.CentreOnParent() - user = preferences.GetPreference('userid') + user = prefs.get('userid', None) if user: dialog.GetTextctrlUsername().SetValue(user) dialog.GetTextctrlPassword().SetFocus() @@ -951,9 +951,9 @@ still_trying = False elif result == wxID_OK: - preferences.prefs['ShowLoginConfirmation'] = dialog.GetCheckboxConfirmed().GetValue() + prefs['ShowLoginConfirmation'] = dialog.GetCheckboxConfirmed().GetValue() self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, dialog.GetCheckboxConfirmed().GetValue()) - preferences.CreatePreferencesFile(preferences.prefs) + preferences.CreatePreferencesFile(prefs) self.secure = dialog.GetCheckboxUseSSL().GetValue() self.dm.serverName = dialog.GetRepository().GetStringSelection() self.dm.user.id = dialog.GetTextctrlUsername().GetValue() @@ -994,7 +994,7 @@ dialog.Destroy() still_trying = False - if preferences.GetPreference('ShowLoginConfirmation'): + if prefs.get('ShowLoginConfirmation', None): if self.State.currentprojectname: sdlg = wxMessageDialog(self, "Login successful.", "Yay!", wxOK) else: @@ -1016,7 +1016,6 @@ if self.Closing: event.Skip() else: - prefs = preferences.prefs preferences.CreatePreferencesFile(prefs) if not self.WorkInProgress: #clean up the [tsv, properties, xls] files in the tmp directory Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.20 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.21 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.20 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Mon Aug 9 17:55:32 2004 @@ -20,8 +20,8 @@ except: print "NOTE: Conversion for import of MS Excel Parts Lists is not available." -import pangalactic.utils.toolframe as toolframe -import pangalactic.utils.preferences as preferences +from pangalactic.utils import toolframe +from pangalactic.utils import preferences from pangalactic.client.modules.plm.ms2file_new_wdr import * from pangalactic.client.modules.plm.epimsgrid import * @@ -919,7 +919,7 @@ if self.dm.user.id: userid = self.dm.user.id else: - userid = preferences.GetPreference('userid') + userid = preferences.prefs.get('userid', None) mapfilename = os.path.join(self.State.workingdir, "data", userid) + ".map" mapfile = open (mapfilename, "w", 1) for colndx, info in self.ColumnInfo.items(): @@ -933,7 +933,7 @@ if self.dm.user.id: userid = self.dm.user.id else: - userid = preferences.GetPreference('userid') + userid = preferences.prefs.get('userid', None) mapfilename = os.path.join(self.State.workingdir, "data", userid) + ".map" dlg = None Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.4 PanGalactic/pangalactic/client/modules/psm/docform.py:1.5 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.4 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Mon Aug 9 17:55:33 2004 @@ -4,7 +4,7 @@ from pangalactic.client.modules.psm.docform_wdr import * -import pangalactic.utils.preferences as preferences +from pangalactic.utils import preferences from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions @@ -16,11 +16,7 @@ self.parent = parent self.State = state - temp = preferences.GetPreference("nextdocid") - if temp: - self.NextDocId = temp - else: - self.NextDocId = 0 + self.NextDocId = preferences.prefs.get("nextdocid", 0) preferences.prefs["nextdocid"] = self.NextDocId DocFunc(self, True) Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.9 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.10 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.9 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Mon Aug 9 17:55:33 2004 @@ -1,9 +1,9 @@ import os from wxPython.wx import * -from pangalactic.utils.mixin_security import Security_Mixin +from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -import pangalactic.utils.preferences as preferences +from pangalactic.utils import preferences from pangalactic.client.modules.psm.modelform_wdr import * @@ -78,11 +78,9 @@ def getNextId(self): #print "modelform.getnextid" - temp = preferences.GetPreference("nextid") + temp = preferences.prefs.get("nextid", "0") if temp: self.NextId = str(int(temp) + 1) - else: - self.NextId = "0" preferences.prefs["nextid"] = self.NextId #print "nextid", self.NextId @@ -215,14 +213,13 @@ self.clearForm() self.fillForm(modelobj) self.Enable(False) - + + def revertNextId(self): #print "modelform.revertnextid" - nextid = preferences.GetPreference("nextid") + nextid = preferences.prefs.get("nextid", "0") if nextid: nextid = int(nextid) - 1 - else: - nextid = 0 preferences.prefs["nextid"] = nextid preferences.CreatePreferencesFile(preferences.prefs) #print "nextid", nextid Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.24 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.25 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.24 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Mon Aug 9 17:55:33 2004 @@ -2,7 +2,7 @@ from wxPython.wx import * from otherdoc_wdr import * -import pangalactic.utils.preferences as preferences +from pangalactic.utils import preferences from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions #import pangalactic.enterprise.document as document @@ -14,11 +14,7 @@ self.parent = parent self.State = state - temp = preferences.GetPreference("nextdocid") - if temp: - self.NextDocId = temp - else: - self.NextDocId = 0 + self.NextDocId = preferences.prefs.get("nextdocid", 0) preferences.prefs["nextdocid"] = self.NextDocId OtherDocFunc(self, True) Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.9 PanGalactic/pangalactic/client/modules/psm/partform.py:1.10 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.9 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Mon Aug 9 17:55:33 2004 @@ -4,7 +4,7 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -import pangalactic.utils.preferences as preferences +from pangalactic.utils import preferences from pangalactic.client.modules.psm.partform_wdr import * @@ -63,11 +63,8 @@ def getNextId(self): #print "partform.getnextid" - temp = preferences.GetPreference('nextid') - if temp: - self.NextId = str(int(temp) + 1) - else: - self.NextId = "0" + temp = preferences.prefs.get('nextid', '-1') + self.NextId = str(int(temp) + 1) preferences.prefs['nextid'] = self.NextId @@ -199,11 +196,8 @@ def revertNextId(self): #print "partform.revertnextid" - nextid = preferences.GetPreference('nextid') - if nextid: - nextid = int(nextid) - 1 - else: - nextid = 0 + nextid = preferences.prefs.get('nextid', '1') + nextid = int(nextid) - 1 preferences.prefs['nextid'] = nextid preferences.CreatePreferencesFile(preferences.prefs) self.NextId = None Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.132 PanGalactic/pangalactic/utils/datamanager.py:1.133 --- PanGalactic/pangalactic/utils/datamanager.py:1.132 Mon Aug 9 14:18:18 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 9 17:55:33 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.132 $ +@version: $Revision: 1.133 $ """ -__version__ = "$Revision: 1.132 $"[11:-2] +__version__ = "$Revision: 1.133 $"[11:-2] import time import mx.DateTime @@ -40,24 +40,28 @@ class DataManager: """ Manager of all data transactions for PanGalaxian. + + @param watchdog: an instance of SecurityManager to handle roles, etc. + @type watchdog: L{pangalactic.utils.securitymanager.SecurityManager} """ - def __init__(self, parent, currentprojectname=None, + def __init__(self, watchdog=None, currentprojectname=None, clearcache=None, domains='PanGalactic', _registry=None): self.initLocalDB(clearcache) - self.parent = parent self.domains = domains self._registry = _registry or PanGalacticRegistry() - self.user = Person(_loggedin = False) + self.inLocalMode = True + self.watchdog = watchdog or SecurityManager() + self.watchdog.inLocalMode = self.inLocalMode + self.user = self.watchdog._User self.auth = None self.serverName = "localhost" self.serverPort = None - servernameandport = preferences.GetPreference('server') + servernameandport = preferences.prefs.get('server', None) if servernameandport: self.serverName, self.serverPort = servernameandport.split(":") self.server = None - self.inLocalMode = True self.refresh = False self.CurrentProject = None self.setCurrentProject(currentprojectname) @@ -74,13 +78,13 @@ def _createServer(self, username, password, secure=1): - server = preferences.GetPreference('server') + server = preferences.prefs.get('server', None) if server: self.serverName, self.serverPort = server.split(':') else: self.serverPort = "8080" - proxy = preferences.GetPreference('proxy') + proxy = preferences.prefs.get('proxy', None) if proxy: proxyhost, proxyport = proxy.split(':') else: @@ -260,9 +264,9 @@ preferences.prefs['userid'] = username temp_user = Person() user = [temp_user] - self.parent.WatchDog.MakeUser(user[0].__dict__) - self.parent.WatchDog._User._authorization = self.auth - self.user = self.parent.WatchDog.GetUser() + self.watchdog.MakeUser(user[0].__dict__) + self.watchdog._User._authorization = self.auth + self.user = self.watchdog.GetUser() self.user.id = username self.user._password = password self.user._loggedin = True @@ -276,9 +280,9 @@ tmp_role.project = 'H2G2' tmp_roles.append(tmp_role) - self.parent.WatchDog.SetRoles(tmp_roles) + self.setRoles(tmp_roles) user2save = Person() - user2save = copy.deepcopy(self.parent.WatchDog.GetUser()) + user2save = copy.deepcopy(self.watchdog.GetUser()) user2save._authorization = None user2save._password = None self.saveUser(user2save) @@ -296,6 +300,14 @@ # return False + def setRoles(self, roles): + """ + Set the watchdog's roles and save them locally. + """ + self.saveRoles(roles) + self.watchdog.setRoles(roles) + + def getItemsByProject(self, projectlist): """ Retrieves the items associated with a project Index: PanGalactic/pangalactic/utils/preferences.py diff -u PanGalactic/pangalactic/utils/preferences.py:1.3 PanGalactic/pangalactic/utils/preferences.py:1.4 --- PanGalactic/pangalactic/utils/preferences.py:1.3 Fri Mar 5 16:18:16 2004 +++ PanGalactic/pangalactic/utils/preferences.py Mon Aug 9 17:55:33 2004 @@ -18,19 +18,13 @@ fileread = 1 -def GetPreference(key): - if prefs.has_key(key): - return prefs[key] - else: - return None - def CreatePreferencesFile(prefsdict): fo = open(PrefsFilename, 'w') for key, value in prefsdict.items(): fo.write(key + ' ~ ' + str(value) + '\n') fo.close() - + def AddPreference(prefname, prefvalue): if prefname and prefvalue: prefs[prefname] = prefvalue - + Index: PanGalactic/pangalactic/utils/securitymanager.py diff -u PanGalactic/pangalactic/utils/securitymanager.py:1.9 PanGalactic/pangalactic/utils/securitymanager.py:1.10 --- PanGalactic/pangalactic/utils/securitymanager.py:1.9 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/securitymanager.py Mon Aug 9 17:55:33 2004 @@ -1,6 +1,13 @@ -import pangalactic.enterprise.person -import pangalactic.enterprise.pgefrole +# $Id: securitymanager.py,v 1.10 2004/08/09 21:55:33 waterbug Exp $ +""" +Manager of security permissions for PanGalaxian. + +@version: $Revision: 1.10 $ +""" +__version__ = "$Revision: 1.10 $"[11:-2] + +from pangalactic.enterprise.person import Person class Roles: def __init__(self): @@ -93,13 +100,14 @@ } -class SecurityManager: - def __init__(self, datamanager = None): +class SecurityManager: + def __init__(self, user=None, inLocalMode=True): self._Roles = None - self._dm = datamanager - self._User = pangalactic.enterprise.person.Person() + self._User = user or Person(pgef_oid='test', + id='test') + self.inLocalMode = inLocalMode self.RejectedList = [] - + def SetUser(self, user): self._User = user @@ -115,8 +123,7 @@ def GetUserAuth(self): return self._User._authorization - def SetRoles(self, roles): - self._dm.saveRoles(roles) + def setRoles(self, roles): self._User.comp_role_bit_mask = {} temp = {} @@ -140,9 +147,10 @@ currentrole.append(role) return currentrole else: - if self._dm.inLocalMode: + if self.inLocalMode: return [roles.GDA] # change if roles are enforced locally - + + def GetActions(self, project): actions = [] myroles = self.GetRoles(project) @@ -182,7 +190,7 @@ if object: if 'P' in role: if action == objectstatus.DELETE or action == objectstatus.MODIFY: - if object.owner == self._dm.user.id: + if object.owner == self._User.id: return True elif action == objectstatus.ADD: return True From waterbug at ned.gsfc.nasa.gov Tue Aug 10 01:09:51 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 10 01:09:52 2004 Subject: [Pangalactic-commits] Bad platform dependency, bad! Message-ID: <200408100509.i7A59pru001914@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/pgertap.py 1.29 1.30 Log message: Bad platform dependency, bad! Index: PanGalactic/pangalactic/pgertap.py diff -u PanGalactic/pangalactic/pgertap.py:1.29 PanGalactic/pangalactic/pgertap.py:1.30 --- PanGalactic/pangalactic/pgertap.py:1.29 Sun Aug 8 22:29:44 2004 +++ PanGalactic/pangalactic/pgertap.py Tue Aug 10 01:09:49 2004 @@ -1,11 +1,13 @@ """ Twisted Tap-builder for the Pan Galactic Repository Service -@version: $Revision: 1.29 $ +@version: $Revision: 1.30 $ """ -__version__ = "$Revision: 1.29 $"[11:-2] +__version__ = "$Revision: 1.30 $"[11:-2] # $Source: /repo/step_testbed/PanGalactic/pangalactic/pgertap.py,v $ +import os + # Twisted imports ... from twisted.application import internet from twisted.application.service import Application @@ -116,8 +118,8 @@ site = web.server.Site(mux) if encrypted: - privkey = '/'.join([home, 'ssl/privkey.pem']) - certifc = '/'.join([home, 'ssl/cert.pem']) + privkey = os.path.join(home, 'ssl/privkey.pem') + certifc = os.path.join(home, 'ssl/cert.pem') ctx = ssl.DefaultOpenSSLContextFactory(privkey, certifc) webserv = internet.SSLServer(webport, site, ctx) else: From waterbug at ned.gsfc.nasa.gov Tue Aug 10 12:13:43 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 10 12:13:47 2004 Subject: [Pangalactic-commits] Massive changes; _default_display_x especially; some breakage. Message-ID: <200408101613.i7AGDhij010286@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.107 1.108 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.36 1.37 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.143 1.144 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.34 1.35 PanGalactic/pangalactic/client/support/SOAP.py 1.3 None PanGalactic/pangalactic/client/support/httpserverinterface.py 1.19 None PanGalactic/pangalactic/client/tests/test_pgefobject.py 1.13 1.14 PanGalactic/pangalactic/client/tests/test_propertiesform.py 1.7 1.8 PanGalactic/pangalactic/enterprise/pgefobject.py 1.63 1.64 PanGalactic/pangalactic/meta/ontoclass.py 1.1 1.2 PanGalactic/pangalactic/meta/ontoproperty.py 1.1 1.2 PanGalactic/pangalactic/utils/datamanager.py 1.133 1.134 PanGalactic/pangalactic/utils/localdb.py 1.103 1.104 PanGalactic/pangalactic/utils/securitymanager.py 1.10 1.11 Log message: Massive changes; _default_display_x especially; some breakage. Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.34 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.35 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.34 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Tue Aug 10 12:13:38 2004 @@ -25,7 +25,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.34 $"[11:-2] +__version__ = "$Revision: 1.35 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -66,7 +66,7 @@ nodeid = rootobj[1] nodeobj = self.dm.getLookupObject(nodeid) if nodeobj: - self.currentdocument.build(nodeobj.__dict__) + self.currentdocument(**nodeobj.__dict__) self.docform.fillForm(self.currentdocument) self.PLMtool = None @@ -149,7 +149,7 @@ self.buildTree() else: partslist.initObject(self.State.currentprojectname, self.dm.user.id) - self.currentdocument.build(partslist.__dict__) + self.currentdocument(**partslist.__dict__) # foobar - SOAP can't handle compound subobjects - pull 'em out and put 'em elsewhere # marshal 'em into a string??? @@ -157,7 +157,7 @@ partslist.ColumnInfo = {} partslist.ColumnMapping = {} - self.currentdocument.build(partslist.__dict__) + self.currentdocument(**partslist.__dict__) self.creatingDocument = False self.OnLinkPartsList() self.docform.GetNewWgt().SetFocus() @@ -380,7 +380,7 @@ partslist.ColumnMapping = {} self.dm.add([partslist]) - self.currentdocument.build(partslist.__dict__) + self.currentdocument(**partslist.__dict__) self.OnLinkPartsList() return True return False Index: PanGalactic/pangalactic/client/tests/test_pgefobject.py diff -u PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.13 PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.14 --- PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.13 Sun Aug 8 22:53:46 2004 +++ PanGalactic/pangalactic/client/tests/test_pgefobject.py Tue Aug 10 12:13:39 2004 @@ -57,7 +57,7 @@ self.obj1 = pgefobject.PgefObject() self.obj2 = pgefobject.PgefObject() self.obj1.popTestData() - self.obj2.build(self.obj1.__dict__) + self.obj2(**self.obj1.__dict__) assert self.obj1.isEqual(self.obj2), 'Object1 and object2 are not equal' Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.107 PanGalactic/pangalactic/client/fnord.py:1.108 --- PanGalactic/pangalactic/client/fnord.py:1.107 Mon Aug 9 17:55:32 2004 +++ PanGalactic/pangalactic/client/fnord.py Tue Aug 10 12:13:38 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.107 2004/08/09 21:55:32 waterbug Exp $ +# $Id: fnord.py,v 1.108 2004/08/10 16:13:38 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.107 $ +@version: $Revision: 1.108 $ """ -__version__ = "$Revision: 1.107 $"[11:-2] +__version__ = "$Revision: 1.108 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -290,21 +290,22 @@ preferences.CreatePreferencesFile(prefs) dlg.Destroy() - self.user = Person(pgef_oid=prefs['userid'], - id=prefs['userid'], - email=prefs['email']) - self.State.currentprojectname = prefs.get('lastproject', None) + useroid = (prefs.get('email', None) or + prefs.get('userid', 'newbie')), + self.user = Person(pgef_oid=useroid, + id=prefs.get('userid', useroid), + email=prefs.get('email', 'local')) + oid.setOidBase(useroid) + self.State.currentprojectname = ( + prefs.get('lastproject', None) or + prefs.get('defaultproject', 'NOPROJECT')) self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, - currentprojectname=self.State.currentprojectname) - email = prefs.get('email', None) - oid.setOidBase(email) - + projectid=self.State.currentprojectname) self.ActivateTool() self.OnServerCombo() - - show_tooltips = prefs.get("ShowToolTips", None) - if show_tooltips == "True": + show_tooltips = prefs.get("ShowToolTips", False) + if show_tooltips: wxToolTip_Enable(True) self.menuBar.Check(ID_PREF_TOOLTIPS, True) else: Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.36 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.37 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.36 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Tue Aug 10 12:13:38 2004 @@ -17,7 +17,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils import preferences -__version__ = "$Revision: 1.36 $"[11:-2] +__version__ = "$Revision: 1.37 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -54,7 +54,7 @@ nodeid = rootobj[1] nodeobj = self.dm.getLookupObject(nodeid) if nodeobj: - self.currentdocument.build(nodeobj.__dict__) + self.currentdocument(**nodeobj.__dict__) self.docform.FillForm(self.currentdocument) self.docform.BrowseMode(True) @@ -122,19 +122,20 @@ if self.EditMode: self.EditMode = False - self.currentdocument.build(newdoc.__dict__) + self.currentdocument(**newdoc.__dict__) else: #print "not editing" - self.currentdocument.build(newdoc.__dict__) - + self.currentdocument(**newdoc.__dict__) return True + def OnEditDoc(self, event): # print "edit doc" self.creatingDocument = True self.EditMode = True self.docform.EditingMode() + def OnLinkDocument(self, event = None): #print "onlinkdoc" node = self.tree.GetSelection() @@ -251,7 +252,7 @@ self.creatingDocument = False self.dm.add([doc]) - self.currentdocument.build(doc.__dict__) + self.currentdocument(**doc.__dict__) self.OnLinkDocument() return True Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.143 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.144 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.143 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Tue Aug 10 12:13:38 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.143 $"[11:-2] +__version__ = "$Revision: 1.144 $"[11:-2] import copy import types @@ -219,8 +219,8 @@ self.currentobj = self.dm.newObject(classname) self.tempobj = self.dm.newObject(classname) - self.currentobj.build(rootobj.__dict__) - self.tempobj.build(self.currentobj.__dict__) + self.currentobj(**rootobj.__dict__) + self.tempobj(**self.currentobj.__dict__) if classname == "Part": self.rootobjs[self.PartPage] = rootobj @@ -1044,8 +1044,8 @@ plobj = self.dm.getLookupObject(nodeid) self.currentobj = self.dm.newObject("PartsList") self.tempobj = self.dm.newObject("PartsList") - self.currentobj.build(plobj.__dict__) - self.tempobj.build(plobj.__dict__) + self.currentobj(**plobj.__dict__) + self.tempobj(**plobj.__dict__) self.partslistform.fillForm(self.currentobj) self.partslistform.BrowseMode(False) @@ -1087,8 +1087,8 @@ if partobj: self.currentobj = self.dm.newObject("Part") self.tempobj = self.dm.newObject("Part") - self.currentobj.build(partobj.__dict__) - self.tempobj.build(partobj.__dict__) + self.currentobj(**partobj.__dict__) + self.tempobj(**partobj.__dict__) self.partform.fillForm(self.currentobj) elif self.currentpage == self.ModelPage: @@ -1129,8 +1129,8 @@ if modelobj: self.currentobj = self.dm.newObject("Model") self.tempobj = self.dm.newObject("Model") - self.currentobj.build(modelobj.__dict__) - self.tempobj.build(modelobj.__dict__) + self.currentobj(**modelobj.__dict__) + self.tempobj(**modelobj.__dict__) self.modelform.fillForm(self.currentobj) elif self.currentpage == self.DocPage: @@ -1168,8 +1168,8 @@ docobj = self.dm.getLookupObject(nodeid) self.currentobj = self.dm.newObject("Document") self.tempobj = self.dm.newObject("Document") - self.currentobj.build(docobj.__dict__) - self.tempobj.build(docobj.__dict__) + self.currentobj(**docobj.__dict__) + self.tempobj(**docobj.__dict__) self.documentform.fillForm(self.currentobj) self.documentform.BrowseMode(False) @@ -1493,8 +1493,8 @@ save_object.state = objectstatus.ADD self.dm.add([save_object]) - self.currentobj.build(save_object.__dict__) - self.tempobj.build(save_object.__dict__) + self.currentobj(**save_object.__dict__) + self.tempobj(**save_object.__dict__) self.dm.addProjectObjects(self.State.currentprojectname, [save_object]) # replace all this with the above line --vwk Index: PanGalactic/pangalactic/client/tests/test_propertiesform.py diff -u PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.7 PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.8 --- PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.7 Fri Mar 5 16:18:12 2004 +++ PanGalactic/pangalactic/client/tests/test_propertiesform.py Tue Aug 10 12:13:39 2004 @@ -39,7 +39,7 @@ testframe.propform = None testframe.propform = modules.psm.propertiesform.PropertiesForm(testframe, -1, state) testframe.propform._loggedin = true - testframe.propform.GetData('.', tempitem, testframe.WatchDog.GetUser(), 'ned.gsfc.nasa.gov',80) + testframe.propform.GetData('.', tempitem, testframe.WatchDog.user, 'ned.gsfc.nasa.gov',80) assert os.path.exists(os.path.join('.','tmp','ned.gsfc.nasa.gov__.properties')), \ "Couldn't download properties file" Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.63 PanGalactic/pangalactic/enterprise/pgefobject.py:1.64 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.63 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Tue Aug 10 12:13:40 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.63 2004/08/09 01:35:39 waterbug Exp $ +# $Id: pgefobject.py,v 1.64 2004/08/10 16:13:40 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.63 $ +@version: $Revision: 1.64 $ """ -__version__ = "$Revision: 1.63 $"[11:-2] +__version__ = "$Revision: 1.64 $"[11:-2] import types import string @@ -83,18 +83,6 @@ they are defined as Python descriptors and listed in the _properties attribute of the class.) """ - _default_display_order = ["id", - "name", - "description", - "create_datetime", - "creator"] - _default_display_names = {"id" : "ID", - "name" : "Name", - "description" : "Description", - "create_datetime" : "Created", - "creator" : "Creator"} - _default_display_types = {} - # pgef_oid, create_datetime, and mod_datetime are excluded # fields because they receive non-null default values at # initialization time. @@ -165,6 +153,7 @@ id_context='PanGalactic', name='ID', pgef_datatype='str', + default_display='True', description=""" [step:id] [rdf:ID] Id is an identifier that is unique within some specified context (the id_context). There are no @@ -200,6 +189,7 @@ id_context='PanGalactic', name='Name', pgef_datatype='str', + default_display='True', description=""" [rdfs:label] A presentation name or human-readable name for the object -- usually the name by which the object is known to an @@ -213,6 +203,7 @@ id_context='PanGalactic', name='Description', pgef_datatype='str', + default_display='True', description=""" [rdf:Description] A narrative about the characteristics and identifying features of the object. @@ -308,14 +299,16 @@ name='Creator', pgef_datatype='Person', property_type='object', + default_display='True', description=""" [pgef:creator] The person who created the object. """), OntoProperty( id='create_datetime', id_context='PanGalactic', - name='Create Date-Time', + name='Created', pgef_datatype='DateTime', + default_display='True', description=""" [pgef:create_datetime] Date-time of creation of the object. """), @@ -331,7 +324,7 @@ OntoProperty( id='mod_datetime', id_context='PanGalactic', - name='Mod Date-Time', + name='Modified', pgef_datatype='DateTime', description=""" [pgef:mod_datetime] Date-time of last modification of the @@ -358,10 +351,14 @@ formats, etc. """) ]) # end of _schema + _default_display_order = _schema._default_display_order + _default_display_names = _schema._default_display_names + _default_display_types = _schema._default_display_types + def __init__(self, **kw): """ - Initialize a PgefObject. + Initialize a PgefObject instance. """ # TODO: bring in attribute definitions from # create_pgerdb_tables.sql and format them in epydoc @@ -386,9 +383,10 @@ self._display_order = copy.copy(self._default_display_order) # TODO: generate these from the OntoProperty.display_name's self._display_names = self._default_display_names.copy() - self._display_types = self._default_display_types.copy() + # self._display_types = self._default_display_types.copy() + - def getDisplayMap(self, dorder = None, dnames = None, dtypes = None): + def getDisplayMap(self, dorder=None, dnames=None, dtypes=None): """ Generate a grid map from the combination of a display_order list, a display_names mapping, and a @@ -573,17 +571,6 @@ retval = False return retval - def build(self, datadict): - """ - Fill an instance's schema from a dict. - - @type datadict: dictionary - @param datadict: a dictionary of instance attributes of the class - and their values - """ - for a in datadict: - if a in self._schema: - setattr(self, a, datadict[a]) def isEmpty(self): """ Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.103 PanGalactic/pangalactic/utils/localdb.py:1.104 --- PanGalactic/pangalactic/utils/localdb.py:1.103 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/localdb.py Tue Aug 10 12:13:41 2004 @@ -8,20 +8,6 @@ import mx.DateTime -from pangalactic.enterprise.pgefobject import PgefObject -from pangalactic.enterprise.part import Part -from pangalactic.enterprise.model import Model -from pangalactic.enterprise.acu import Acu -from pangalactic.enterprise.dcu import Dcu -from pangalactic.enterprise.partslist import PartsList -from pangalactic.enterprise.person import Person -from pangalactic.enterprise.pgefrole import PgefRole -from pangalactic.enterprise.pgefrepresentation import PgefRepresentation -from pangalactic.enterprise.project import Project -from pangalactic.enterprise.document import Document -from pangalactic.enterprise.organization import Organization -from pangalactic.enterprise.pgeffile import PgefFile - from pangalactic.meta.ontology import Ontology from pangalactic.meta.ontoclass import OntoClass from pangalactic.meta.ontoproperty import OntoProperty @@ -31,15 +17,6 @@ from pangalactic.enterprise.workflow.wfeventaudit import WfEventAudit from pangalactic.enterprise.workflow.wftransition import WfTransition -# from nars.enterprise.pgefadvisory import PgefAdvisory -# from nars.enterprise.nasaadvisory import NasaAdvisory -# from nars.enterprise.gidepdmsmsnotice import GidepDmsmsNotice -# from nars.enterprise.gidepagencyactionnotice import GidepAgencyActionNotice -# from nars.enterprise.gidepproductchangenotice import GidepProductChangeNotice -# from nars.enterprise.gidepalert import GidepAlert -# from nars.enterprise.gidepproblemadvisory import GidepProblemAdvisory -# from nars.enterprise.problemimpactstatement import ProblemImpactStatement - import pangalactic.utils.objectstatus as objectstatus import ZODB @@ -57,17 +34,9 @@ admin = 10 user = 1 -PGEF_CLASSES = ["Project", "Acu", "Dcu", "Part", "Model", "Document", - "WfActivity", "WfProcessInstance", "WfTransition", - "WfEventAudit"] -### -### PGEF must have no dependence on NARS. -### (NARS should be a configuration option, but shouldn't be mentioned in -### PGEF itself.) -### -# NARS_CLASSES = ["NasaAdvisory", "GidepAlert", "GidepProblemAdvisory", -# "ProblemImpactStatement", "GidepProductChangeNotice", -# "GidepAgencyActionNotice", "GidepDmsmsNotice"] +WF_CLASSES = ["WfActivity", "WfProcessInstance", "WfTransition", + "WfEventAudit"] + EXCLUDE_CLASSES = ["ACUByAssembly", "DisplayConfig", "Passwd", "UncommittedDocumentIDs", "OidLookup", "State"] @@ -101,7 +70,6 @@ USER = "User" WFACTIVITY = "WfActivity" WFEVENTAUDIT = "WfEventAudit" -# WFPROCESS = "WfProcess" WFPROCESSINSTANCE = "WfProcessInstance" WFTRANSITION = "WfTransition" @@ -116,14 +84,7 @@ (DISPLAY_CONFIG, 1, admin), (DCU, 1, admin), (DOCUMENT, 1, user), - # (GIDEPAGENCYACTIONNOTICE, 1, user), - # (GIDEPALERT, 1, user), - # (GIDEPDMSMSNOTICE, 1, user), - # (GIDEPPROBLEMADVISORY, 1, user), - # (GIDEPPRODUCTCHANGENOTICE, 1, user), (MODEL, 1, user), - # (NASAADVISORY, 1, user), - # (PROBLEMIMPACTSTATEMENT, 1, user), (OIDLOOKUP, 1, god), (ORGANIZATION, 0, user), (PART, 1, user), @@ -139,7 +100,6 @@ (USER, 0, admin), (WFACTIVITY, 1, user), (WFEVENTAUDIT, 1, admin), -# (WFPROCESS, 1, user), (WFPROCESSINSTANCE, 1, user), (WFTRANSITION, 1, user)] @@ -151,43 +111,36 @@ MODEL, PART, PARTSLIST, - # NASAADVISORY, - # GIDEPALERT, - # GIDEPPROBLEMADVISORY, - # GIDEPAGENCYACTIONNOTICE, - # GIDEPDMSMSNOTICE, - # GIDEPPRODUCTCHANGENOTICE, - # PROBLEMIMPACTSTATEMENT, PGEFFILE, PROJECT, WFACTIVITY, WFEVENTAUDIT, -# WFPROCESS, WFPROCESSINSTANCE, WFTRANSITION] - # alertdicts = [NASAADVISORY, - # PROBLEMIMPACTSTATEMENT, - # GIDEPPROBLEMADVISORY, - # GIDEPALERT, - # GIDEPAGENCYACTIONNOTICE, - # GIDEPDMSMSNOTICE, - # GIDEPPRODUCTCHANGENOTICE] - - def __init__(self, deletefiles = None): + def __init__(self, _registry, clear=False): + """ + Initialize a LocalStorage instance. + + @param _registry: the PanGalacticRegistry instance (singleton) + @type _registry: L{pangalactic.meta.registry.PanGalacticRegistry} + + @param clear: indicates whether to remove data files + @type clear: bool + """ if not os.path.exists("data"): os.makedirs("data") - - if deletefiles: + if clear: for file in glob.glob("data/*.fs*"): os.remove(file) - self.filename = os.path.join(".","data","pgef.fs") + self._registry = _registry + self.filename = os.path.join(".", "data", "pgef.fs") self.storage = FileStorage.FileStorage(self.filename) self.db = DB(self.storage) self.dbconnection = self.db.open() self.dbroot = self.dbconnection.root() self.Setup() - + def Pack(self): """ @@ -291,22 +244,28 @@ def defaultDisplayConfig(self): #print "localdb.defaultdisplayconfig" current_config = {} - current_config["Acu"] = \ - self.getDefaultDisplayMap(Acu._default_display_names, - Acu._default_display_order, - Acu._default_display_types) - current_config["Dcu"] = \ - self.getDefaultDisplayMap(Dcu._default_display_names, - Dcu._default_display_order, - Dcu._default_display_types) - current_config["Document"] = \ - self.getDefaultDisplayMap(Document._default_display_names, - Document._default_display_order, - Document._default_display_types) - current_config["Model"] = \ - self.getDefaultDisplayMap(Model._default_display_names, - Model._default_display_order, - Model._default_display_types) + for cn in self._registry.pgef_classes: + klass = self._registry.pgef_classes[cn] + current_config[cn] = self.getDefaultDisplayMap( + klass._default_display_names, + klass._default_display_order, + klass._default_display_types) +# current_config["Acu"] = \ +# self.getDefaultDisplayMap(Acu._default_display_names, +# Acu._default_display_order, +# Acu._default_display_types) +# current_config["Dcu"] = \ +# self.getDefaultDisplayMap(Dcu._default_display_names, +# Dcu._default_display_order, +# Dcu._default_display_types) +# current_config["Document"] = \ +# self.getDefaultDisplayMap(Document._default_display_names, +# Document._default_display_order, +# Document._default_display_types) +# current_config["Model"] = \ +# self.getDefaultDisplayMap(Model._default_display_names, +# Model._default_display_order, +# Model._default_display_types) # current_config["OntoClass"] = \ # self.getDefaultDisplayMap(OntoClass._default_display_names, # OntoClass._default_display_order, @@ -315,90 +274,58 @@ # self.getDefaultDisplayMap(OntoProperty._default_display_names, # OntoProperty._default_display_order, # OntoProperty._default_display_types) - current_config["Organization"] = \ - self.getDefaultDisplayMap(Organization._default_display_names, - Organization._default_display_order, - Organization._default_display_types) - current_config["Part"] = \ - self.getDefaultDisplayMap(Part._default_display_names, - Part._default_display_order, - Part._default_display_types) - current_config["PartsList"] = \ - self.getDefaultDisplayMap(PartsList._default_display_names, - PartsList._default_display_order, - PartsList._default_display_types) - current_config["Person"] = \ - self.getDefaultDisplayMap(Person._default_display_names, - Person._default_display_order, - Person._default_display_types) - current_config["PgefFile"] = \ - self.getDefaultDisplayMap(PgefFile._default_display_names, - PgefFile._default_display_order, - PgefFile._default_display_types) - current_config["PgefObject"] = \ - self.getDefaultDisplayMap(PgefObject._default_display_names, - PgefObject._default_display_order, - PgefObject._default_display_types) - # current_config["PgefAdvisory"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["NasaAdvisory"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["GidepProblemAdvisory"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["GidepAlert"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["GidepAgencyActionNotice"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["GidepDmsmsNotice"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["GidepProductChangeNotice"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - # current_config["ProblemImpactStatement"] = \ - # self.getDefaultDisplayMap(PgefAdvisory._default_display_names, - # PgefAdvisory._default_display_order, - # PgefAdvisory._default_display_types) - current_config["Project"] = \ - self.getDefaultDisplayMap(Project._default_display_names, - Project._default_display_order, - Project._default_display_types) - current_config["PgefRole"] = \ - self.getDefaultDisplayMap(PgefRole._default_display_names, - PgefRole._default_display_order, - PgefRole._default_display_types) - current_config["User"] = \ - self.getDefaultDisplayMap(Person._default_display_names, - Person._default_display_order, - Person._default_display_types) - current_config["WfActivity"] = \ - self.getDefaultDisplayMap(WfActivity._default_display_names, - WfActivity._default_display_order, - WfActivity._default_display_types) - current_config["WfProcessInstance"] = \ - self.getDefaultDisplayMap(WfProcessInstance._default_display_names, - WfProcessInstance._default_display_order, - WfProcessInstance._default_display_types) - current_config["WfEventAudit"] = \ - self.getDefaultDisplayMap(WfEventAudit._default_display_names, - WfEventAudit._default_display_order, - WfEventAudit._default_display_types) - current_config["WfTransition"] = \ - self.getDefaultDisplayMap(WfTransition._default_display_names, - WfTransition._default_display_order, - WfTransition._default_display_types) +# current_config["Organization"] = \ +# self.getDefaultDisplayMap(Organization._default_display_names, +# Organization._default_display_order, +# Organization._default_display_types) +# current_config["Part"] = \ +# self.getDefaultDisplayMap(Part._default_display_names, +# Part._default_display_order, +# Part._default_display_types) +# current_config["PartsList"] = \ +# self.getDefaultDisplayMap(PartsList._default_display_names, +# PartsList._default_display_order, +# PartsList._default_display_types) +# current_config["Person"] = \ +# self.getDefaultDisplayMap(Person._default_display_names, +# Person._default_display_order, +# Person._default_display_types) +# current_config["PgefFile"] = \ +# self.getDefaultDisplayMap(PgefFile._default_display_names, +# PgefFile._default_display_order, +# PgefFile._default_display_types) +# current_config["PgefObject"] = \ +# self.getDefaultDisplayMap(PgefObject._default_display_names, +# PgefObject._default_display_order, +# PgefObject._default_display_types) +# current_config["Project"] = \ +# self.getDefaultDisplayMap(Project._default_display_names, +# Project._default_display_order, +# Project._default_display_types) +# current_config["PgefRole"] = \ +# self.getDefaultDisplayMap(PgefRole._default_display_names, +# PgefRole._default_display_order, +# PgefRole._default_display_types) +# current_config["User"] = \ +# self.getDefaultDisplayMap(Person._default_display_names, +# Person._default_display_order, +# Person._default_display_types) +# current_config["WfActivity"] = \ +# self.getDefaultDisplayMap(WfActivity._default_display_names, +# WfActivity._default_display_order, +# WfActivity._default_display_types) +# current_config["WfProcessInstance"] = \ +# self.getDefaultDisplayMap(WfProcessInstance._default_display_names, +# WfProcessInstance._default_display_order, +# WfProcessInstance._default_display_types) +# current_config["WfEventAudit"] = \ +# self.getDefaultDisplayMap(WfEventAudit._default_display_names, +# WfEventAudit._default_display_order, +# WfEventAudit._default_display_types) +# current_config["WfTransition"] = \ +# self.getDefaultDisplayMap(WfTransition._default_display_names, +# WfTransition._default_display_order, +# WfTransition._default_display_types) # print "cfg keys", current_config.keys() self.setDisplayConfig(current_config) # print "default config done" @@ -1090,87 +1017,5 @@ #print "tmpval", tmpval return tmpval return None - - - - def getAlerts(self, attrlist = None, uncommitted_flag = False): - #print "localdb.getalerts", attrlist - tmpdict = {} - dicts_to_check = [] - for dictname in self.alertdicts: - dicts_to_check.append(self.dbroot[dictname]) - - if uncommitted_flag: - udict = {} - for objid, obj in self.dbroot[self.UNCOMMITTEDOBJECTS].items(): - if isinstance(obj, PgefAdvisory): - udict[objid] = obj - dicts_to_check.append(udict) - - if attrlist: - for dict in dicts_to_check: - for docid, doc in dict.items(): -# print "checking", doc.__class__.__name__, doc.id - retval_list = [] - for attrname, op, attrvalue in attrlist: - left = getattr(doc, attrname) -# print " eval", left, op, attrvalue - tmpval = self.evalAttrExp(left, op, attrvalue) - retval_list.append(tmpval) -# if not tmpval: -# print " missing attribute", attrname - - tmpdict[docid] = doc -# print " retval_list", retval_list - for retval in retval_list: -# print " retval", retval - if not retval: -# print " deleting docid", docid - del tmpdict[docid] - break -# else: -# print " retval ok" - else: - for dict in self.alertdicts: - #print "checking", dict - tmpdict.update(dict) - - return tmpdict - - - def getAlertsByUser(self, userid): - tmpdict = {} - docdict = self.getAlerts() - for docid, doc in docdict.items(): - if doc.creator == userid: - tmpdict[docid] = doc - return tmpdict - - - def getAlertsByCenter(self, center_acronym): - #print "alertsbycenter <" + center_acronym + ">" - tmpdict = {} - docdict = self.getAlerts() - for docid, doc in docdict.items(): - if doc.center_acronym == center_acronym: - tmpdict[docid] = doc - return tmpdict - - - - def getUncommittedAlerts(self): - try: - uncommittedobjs = self.dbroot[self.UNCOMMITTEDOBJECTS] - objlist = [] - for objid, obj in uncommittedobjs.items(): - if isinstance(obj, PgefAdvisory): - objlist.append(obj) - if len(obj._files) > 0: - objlist.extend(obj._files) - return objlist - - except: - #print "no uncommitted objects; returning empty list" - return [] Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.133 PanGalactic/pangalactic/utils/datamanager.py:1.134 --- PanGalactic/pangalactic/utils/datamanager.py:1.133 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Tue Aug 10 12:13:41 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.133 $ +@version: $Revision: 1.134 $ """ -__version__ = "$Revision: 1.133 $"[11:-2] +__version__ = "$Revision: 1.134 $"[11:-2] import time import mx.DateTime @@ -36,35 +36,52 @@ from pangalactic.utils.pgefexceptions import LocalStorageError from pangalactic.utils.xmlrpcinterface import XmlrpcInterface +prefs = preferences.prefs + class DataManager: """ Manager of all data transactions for PanGalaxian. - - @param watchdog: an instance of SecurityManager to handle roles, etc. - @type watchdog: L{pangalactic.utils.securitymanager.SecurityManager} """ - def __init__(self, watchdog=None, currentprojectname=None, - clearcache=None, domains='PanGalactic', - _registry=None): + def __init__(self, watchdog=None, projectid=None, _registry=None, + clearcache=False, domains='PanGalactic'): + """ + Initialize a DataManager instance. - self.initLocalDB(clearcache) - self.domains = domains + @param watchdog: the SecurityManager instance (handles roles, etc.) + @type watchdog: L{pangalactic.utils.securitymanager.SecurityManager} + + @param project: the name of the current project + @type project: str + + @param clear: indicates whether to remove ZODB's files + @type clear: bool + + @param domains: specifies which application domains to include + @type domains: str + + @param _registry: the PanGalacticRegistry instance (singleton) + @type _registry: L{pangalactic.meta.registry.PanGalacticRegistry} + """ self._registry = _registry or PanGalacticRegistry() + try: + self.localDB = localdb.LocalStorage(self._registry, clearcache) + except ZODB.POSException.StorageSystemError, e: + raise LocalStorageError, "Local Database StorageError" + self.domains = domains self.inLocalMode = True self.watchdog = watchdog or SecurityManager() self.watchdog.inLocalMode = self.inLocalMode - self.user = self.watchdog._User - self.auth = None + self.user = self.watchdog.user self.serverName = "localhost" self.serverPort = None - servernameandport = preferences.prefs.get('server', None) + servernameandport = prefs.get('server', None) if servernameandport: self.serverName, self.serverPort = servernameandport.split(":") self.server = None self.refresh = False self.CurrentProject = None - self.setCurrentProject(currentprojectname) + self.setCurrentProject(projectid) self.projects = {} self.nauoIDs = {} self.partsListIDs = {} @@ -78,13 +95,13 @@ def _createServer(self, username, password, secure=1): - server = preferences.prefs.get('server', None) + server = prefs.get('server', None) if server: self.serverName, self.serverPort = server.split(':') else: self.serverPort = "8080" - proxy = preferences.prefs.get('proxy', None) + proxy = prefs.get('proxy', None) if proxy: proxyhost, proxyport = proxy.split(':') else: @@ -100,13 +117,6 @@ _registry=self._registry) - def initLocalDB(self, clearcache): - try: - self.localDB = localdb.LocalStorage(clearcache) - self.localDBfilename = self.localDB.filename - - except ZODB.POSException.StorageSystemError, e: - raise LocalStorageError, "Local Database StorageError" def getRoot(self): @@ -201,8 +211,7 @@ classname = parentobj.__class__.__name__ if not filename: filename = parentobj._upload_file_name - if (classname == "Document" or - classname in localdb.NARS_CLASSES): + if (classname == "Document"): obj = PgefFile(_doc = parentobj, name = dlabel, parent = parentobj.pgef_oid, @@ -255,43 +264,35 @@ #print "datamanager.login" self.server = self._createServer(username, password, secure=secure) try: - data = None - if self.server: - data = self.server.yo() - - if data: - self.inLocalMode = False - preferences.prefs['userid'] = username - temp_user = Person() - user = [temp_user] - self.watchdog.MakeUser(user[0].__dict__) - self.watchdog._User._authorization = self.auth - self.user = self.watchdog.GetUser() - self.user.id = username - self.user._password = password - self.user._loggedin = True - - print "NOTE: create tmp role - GDA. Remove RSN" - tmp_roles = [] - tmp_role = PgefRole() - tmp_role.RoleCode = 'GDA' - tmp_role.Userid = username - tmp_role.id = username - tmp_role.project = 'H2G2' - tmp_roles.append(tmp_role) - - self.setRoles(tmp_roles) - user2save = Person() - user2save = copy.deepcopy(self.watchdog.GetUser()) - user2save._authorization = None - user2save._password = None - self.saveUser(user2save) - self.localDB.savePasswds(password, password) - return True - + self.server.yo() except xmlrpclib.ProtocolError, e: print "Exception: datamanager.login", e return False + self.inLocalMode = False + self.watchdog.inLocalMode = False + prefs['lastlogin'] = username + self.watchdog.user = Person(id=username) + self.watchdog.user._password = password + self.watchdog.user._loggedin = True + + print "NOTE: create tmp role - GDA. Remove RSN" + tmp_roles = [] + tmp_role = PgefRole() + tmp_role.RoleCode = 'GDA' + tmp_role.Userid = username + tmp_role.id = username + tmp_role.project = 'H2G2' + tmp_roles.append(tmp_role) + + self.setRoles(tmp_roles) + user2save = Person() + user2save = copy.deepcopy(self.watchdog.user) + user2save._authorization = None + user2save._password = None + self.saveUser(user2save) + self.localDB.savePasswds(password, password) + return True + # except Exception, e: # print "datamanager.login FAILURE" Index: PanGalactic/pangalactic/utils/securitymanager.py diff -u PanGalactic/pangalactic/utils/securitymanager.py:1.10 PanGalactic/pangalactic/utils/securitymanager.py:1.11 --- PanGalactic/pangalactic/utils/securitymanager.py:1.10 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/utils/securitymanager.py Tue Aug 10 12:13:41 2004 @@ -1,11 +1,11 @@ -# $Id: securitymanager.py,v 1.10 2004/08/09 21:55:33 waterbug Exp $ +# $Id: securitymanager.py,v 1.11 2004/08/10 16:13:41 waterbug Exp $ """ Manager of security permissions for PanGalaxian. -@version: $Revision: 1.10 $ +@version: $Revision: 1.11 $ """ -__version__ = "$Revision: 1.10 $"[11:-2] +__version__ = "$Revision: 1.11 $"[11:-2] from pangalactic.enterprise.person import Person @@ -101,30 +101,29 @@ class SecurityManager: + """ + Manager of security permissions for PanGalaxian. + """ + def __init__(self, user=None, inLocalMode=True): + """ + Initialize a Security Manager instance. + + @param user: a Person object representing the user + @type user: L{pangalactic.enterprise.person.Person} + + @param inLocalMode: indicates whether the parent data manager is in + local mode + @type inLocalMode: bool + """ self._Roles = None - self._User = user or Person(pgef_oid='test', - id='test') + self.user = user or Person(pgef_oid='test', id='test') self.inLocalMode = inLocalMode self.RejectedList = [] - def SetUser(self, user): - self._User = user - - def MakeUser(self, userdict): - self._User.build(userdict) - - def GetUser(self): - return self._User - - def SetUserAuth(self, auth): - self._User._authorization = auth - - def GetUserAuth(self): - return self._User._authorization - + def setRoles(self, roles): - self._User.comp_role_bit_mask = {} + self.user.comp_role_bit_mask = {} temp = {} for role in roles: @@ -135,7 +134,7 @@ templist = [] templist.append(role.project) temp[role.RoleCode] = templist - self._User.comp_role_bit_mask = temp + self.user.comp_role_bit_mask = temp self._Roles = temp @@ -190,7 +189,7 @@ if object: if 'P' in role: if action == objectstatus.DELETE or action == objectstatus.MODIFY: - if object.owner == self._User.id: + if object.owner == self.user.id: return True elif action == objectstatus.ADD: return True From waterbug at ned.gsfc.nasa.gov Tue Aug 10 15:07:20 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 10 15:07:22 2004 Subject: [Pangalactic-commits] Fixed ID_TOOL_ALERTS; more work on default_display stuff. Message-ID: <200408101907.i7AJ7Kg8013109@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.169 1.170 PanGalactic/pangalactic/enterprise/acu.py 1.11 1.12 PanGalactic/pangalactic/enterprise/dcu.py 1.12 1.13 PanGalactic/pangalactic/enterprise/document.py 1.57 1.58 PanGalactic/pangalactic/enterprise/pgefobject.py 1.64 1.65 PanGalactic/pangalactic/utils/datamanager.py 1.134 1.135 Log message: Fixed ID_TOOL_ALERTS; more work on default_display stuff. Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.134 PanGalactic/pangalactic/utils/datamanager.py:1.135 --- PanGalactic/pangalactic/utils/datamanager.py:1.134 Tue Aug 10 12:13:41 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Tue Aug 10 15:07:19 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.134 $ +@version: $Revision: 1.135 $ """ -__version__ = "$Revision: 1.134 $"[11:-2] +__version__ = "$Revision: 1.135 $"[11:-2] import time import mx.DateTime @@ -439,6 +439,12 @@ refs = 1, subtypes = 0, objs = None) print "found", len(projs), "TEST projects" + if len(projs): + print 'they are:' + for p in projs: + print p.id + else: + print 'no projects found' self.localDB.save(projs) self.projects = self.localDB.getDict(self.localDB.PROJECT) Index: PanGalactic/pangalactic/enterprise/acu.py diff -u PanGalactic/pangalactic/enterprise/acu.py:1.11 PanGalactic/pangalactic/enterprise/acu.py:1.12 --- PanGalactic/pangalactic/enterprise/acu.py:1.11 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/acu.py Tue Aug 10 15:07:18 2004 @@ -1,4 +1,4 @@ -# $Id: acu.py,v 1.11 2004/08/09 01:35:39 waterbug Exp $ +# $Id: acu.py,v 1.12 2004/08/10 19:07:18 waterbug Exp $ """ Assembly Component Usage (ACU) @@ -7,10 +7,10 @@ I{component}) and another Model (the I{assembly}) of which it is a constituent part. -@version: $Revision: 1.11 $ +@version: $Revision: 1.12 $ """ -__version__ = "$Revision: 1.11 $"[11:-2] +__version__ = "$Revision: 1.12 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -22,18 +22,7 @@ I{component}) and another Model (the I{assembly}) of which it is a constituent part. """ - _default_display_order = ["assembly", - "component", - "owner", - "creator", - "ref_designator"] - _default_display_names = {"assembly" : "Assembly", - "component" : "Component", - "owner" : "Owner", - "creator" : "Creator", - "ref_designator" : "Ref. Designator"} _properties = PgefObject._properties.copy() - _required = ['assembly', 'component'] _schema = OntoClass( id='Acu', id_context='PanGalactic', @@ -64,6 +53,7 @@ pgef_datatype='Model', property_type='object', min_cardinality=1, + default_display='True', description=""" The Model in which the component appears as a part. @@ -75,6 +65,7 @@ pgef_datatype='Model', property_type='object', min_cardinality=1, + default_display='True', description=""" The Model in the construction of which the component is used. @@ -84,6 +75,7 @@ id_context='PanGalactic', name='Reference Designator', pgef_datatype='str', + default_display='True', description=""" A symbolic name that serves as an identifier for this component usage within the assembly. Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.169 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.170 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.169 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Tue Aug 10 15:07:18 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.169 $"[11:-2] +__version__ = "$Revision: 1.170 $"[11:-2] import os @@ -470,10 +470,10 @@ else: self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, False) - if self.Allowed(actions.ADDDOCUMENT): ## vwk - need alert access flag - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, True) - else: - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, False) +# if self.Allowed(actions.ADDDOCUMENT): ## vwk - need alert access flag +# self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, True) +# else: +# self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, False) if self.Allowed(actions.MODIFYALL): pass Index: PanGalactic/pangalactic/enterprise/dcu.py diff -u PanGalactic/pangalactic/enterprise/dcu.py:1.12 PanGalactic/pangalactic/enterprise/dcu.py:1.13 --- PanGalactic/pangalactic/enterprise/dcu.py:1.12 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/dcu.py Tue Aug 10 15:07:18 2004 @@ -1,4 +1,4 @@ -# $Id: dcu.py,v 1.12 2004/08/09 01:35:39 waterbug Exp $ +# $Id: dcu.py,v 1.13 2004/08/10 19:07:18 waterbug Exp $ """ Document Component Usage (DCU) @@ -7,10 +7,10 @@ I{component}) and another Document (the I{assembly}) in which it occurs as a part. -@version: $Revision: 1.12 $ +@version: $Revision: 1.13 $ """ -__version__ = "$Revision: 1.12 $"[11:-2] +__version__ = "$Revision: 1.13 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -24,6 +24,7 @@ I{component}) and another Document (the I{assembly}) in which it occurs as a part. """ + _properties = PgefObject._properties.copy() _schema = OntoClass( id='Dcu', id_context='PanGalactic', @@ -44,6 +45,7 @@ pgef_datatype='Document', property_type='object', min_cardinality=1, + default_display='True', description=""" The Document in which the component appears as a part."""), @@ -54,6 +56,7 @@ pgef_datatype='Document', property_type='object', min_cardinality=1, + default_display='True', description=""" The Document in the construction of which the component is used."""), @@ -62,14 +65,13 @@ id_context='PanGalactic', name='Reference Designator', pgef_datatype='str', + default_display='True', description=""" A reference designator should be an identifier that is unique within the local Document's name space, and could be used to order attachments, for example.""") ]) # end of _schema - _properties = PgefObject._properties.copy() - _required = [] def __init__(self, **kw): """ Index: PanGalactic/pangalactic/enterprise/document.py diff -u PanGalactic/pangalactic/enterprise/document.py:1.57 PanGalactic/pangalactic/enterprise/document.py:1.58 --- PanGalactic/pangalactic/enterprise/document.py:1.57 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/document.py Tue Aug 10 15:07:18 2004 @@ -1,10 +1,10 @@ -# $Id: document.py,v 1.57 2004/08/09 01:35:39 waterbug Exp $ +# $Id: document.py,v 1.58 2004/08/10 19:07:18 waterbug Exp $ """ Document is the Mother of all PanGalactic Document types. :) """ -__version__ = "$Revision: 1.57 $"[11:-2] +__version__ = "$Revision: 1.58 $"[11:-2] from mx import DateTime import string @@ -27,17 +27,6 @@ L{pangalactic.enterprise.pgeffile.PgefFile} objects associated with it (e.g., a DTD, a stylesheet, an XML file, etc.). """ - _default_display_names = {"Title" : "Title", - "creator" : "Creator", - "Revision" : "Rev", - "Date" : "Date", - "DocType" : "Type"} - _default_display_order = ["Title", - "creator", - "Revision", - "Date", - "DocType"] - _default_display_types = {} _excluded_fields = VersionedObject._excluded_fields # These are from the Dublin Core, and are computed attributes _properties = {'Title' : 'str', @@ -48,7 +37,6 @@ 'Description' : 'str', 'Date' : 'str', 'DocType' : 'str'} - _required = [] # for the time being, don't require anything _schema = OntoClass( id='Document', id_context='PanGalactic', @@ -92,6 +80,8 @@ id_context='PanGalactic', name='Name', pgef_datatype='str', + default_display='True', + display_name='Title', description=""" (Overrides definition inherited from PgefObject.) Semantic depends on the value of the structural_role @@ -159,6 +149,8 @@ id_context='PanGalactic', name='Date and Time Published', pgef_datatype='DateTime', + default_display='True', + display_name='Published', description=""" Date (and time, if relevant) the Document was published. @@ -183,12 +175,7 @@ Initialize a Document object. """ VersionedObject.__init__(self, **kw) - for a in kw: - if a in self._properties: - try: - setattr(self, a, kw[a]) - except: - pass # some properties might be read-only + def addFile(self, f): """ @@ -198,6 +185,7 @@ """ self.files.append(f) + def getFiles(self): """ Get all PgefFiles for the current version. @@ -209,10 +197,13 @@ """ return self.files + ####################################### ### property definitions begin here ### ####################################### + ### dc:Title ### + def deleteAttr(self): # generic function for attributes that can't be deleted raise TypeError, 'Cannot delete this attribute' @@ -228,6 +219,8 @@ Title = property(getTitle, setTitle, deleteAttr, 'Title') + ### title (yes, weird) ### + def gettitle(self): """ Get the title of the Document. title maps to 'name'. @@ -239,6 +232,8 @@ title = property(gettitle, settitle, deleteAttr, 'title') + ### dc:Identifier ### + def getIdentifier(self): """ Get the Identifier of the Document. Identifier maps to @@ -254,6 +249,8 @@ deleteAttr, 'Identifier') + ### dc:Creator ### + def getCreator(self): # for now, 'creator' is taken to be the id of the initial # creator of the Document. Actually, we probably want @@ -269,6 +266,8 @@ Creator = property(getCreator, setCreator, deleteAttr, 'Creator') + ### dc:Revision ### + def getRevision(self): """ Get the value of the Revision, which maps to the @@ -285,6 +284,8 @@ Revision = property(getRevision, setRevision, deleteAttr, 'Revision') + ### rdf:Description ### + def getDescription(self): """ Get the value of the Description, which maps to the @@ -301,6 +302,8 @@ Description = property(getDescription, setDescription, deleteAttr, 'Description') + ### dc:Date ### + def getDate(self): """ Get the value of self.Date, which maps to the @@ -327,6 +330,8 @@ Date = property(getDate, setDate, deleteAttr, 'Date') + + ### pgef:DocType ### def getDocType(self): """ Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.64 PanGalactic/pangalactic/enterprise/pgefobject.py:1.65 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.64 Tue Aug 10 12:13:40 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Tue Aug 10 15:07:18 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.64 2004/08/10 16:13:40 waterbug Exp $ +# $Id: pgefobject.py,v 1.65 2004/08/10 19:07:18 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.64 $ +@version: $Revision: 1.65 $ """ -__version__ = "$Revision: 1.64 $"[11:-2] +__version__ = "$Revision: 1.65 $"[11:-2] import types import string @@ -383,7 +383,13 @@ self._display_order = copy.copy(self._default_display_order) # TODO: generate these from the OntoProperty.display_name's self._display_names = self._default_display_names.copy() - # self._display_types = self._default_display_types.copy() + # populate Python properties, if settable and passed in as kw's + for a in kw: + if a in self._properties: + try: + setattr(self, a, kw[a]) + except: + pass # some properties might be read-only def getDisplayMap(self, dorder=None, dnames=None, dtypes=None): From waterbug at ned.gsfc.nasa.gov Wed Aug 11 02:21:13 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 11 02:21:16 2004 Subject: [Pangalactic-commits] Good progress, but display of objects is borked. Message-ID: <200408110621.i7B6LDvS019892@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/tests/test_partslist.py 1.13 1.14 PanGalactic/pangalactic/client/tests/test_person.py 1.10 1.11 PanGalactic/pangalactic/client/tests/test_pgefobject.py 1.14 1.15 PanGalactic/pangalactic/enterprise/mime.py 1.1 1.2 PanGalactic/pangalactic/enterprise/model.py 1.10 1.11 PanGalactic/pangalactic/enterprise/organization.py 1.20 1.21 PanGalactic/pangalactic/enterprise/part.py 1.9 1.10 PanGalactic/pangalactic/enterprise/partslist.py 1.23 1.24 PanGalactic/pangalactic/enterprise/person.py 1.22 1.23 PanGalactic/pangalactic/enterprise/personrole.py 1.1 1.2 PanGalactic/pangalactic/enterprise/pgeffile.py 1.25 1.26 PanGalactic/pangalactic/enterprise/pgefobject.py 1.65 1.66 PanGalactic/pangalactic/enterprise/pgefrepresentation.py 1.1 1.2 PanGalactic/pangalactic/enterprise/pgefrole.py 1.1 1.2 PanGalactic/pangalactic/enterprise/project.py 1.24 1.25 PanGalactic/pangalactic/enterprise/versionedobject.py 1.14 1.15 PanGalactic/pangalactic/enterprise/ontoclass.py 1.6 None PanGalactic/pangalactic/enterprise/ontoproperty.py 1.8 None PanGalactic/pangalactic/meta/ontoclass.py 1.2 1.3 PanGalactic/pangalactic/utils/localdb.py 1.104 1.105 PanGalactic/pangalactic/utils/pgefdatatable.py 1.15 1.16 PanGalactic/pangalactic/utils/pgefexceptions.py 1.4 1.5 Log message: Good progress, but display of objects is borked. Index: PanGalactic/pangalactic/enterprise/organization.py diff -u PanGalactic/pangalactic/enterprise/organization.py:1.20 PanGalactic/pangalactic/enterprise/organization.py:1.21 --- PanGalactic/pangalactic/enterprise/organization.py:1.20 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/organization.py Wed Aug 11 02:21:09 2004 @@ -1,4 +1,4 @@ -# $Id: organization.py,v 1.20 2004/08/09 01:35:39 waterbug Exp $ +# $Id: organization.py,v 1.21 2004/08/11 06:21:09 waterbug Exp $ """ An Organization is a business entity composed of personnel and @@ -14,15 +14,6 @@ An Organization is a business entity composed of personnel and other resources. """ - _default_display_order = ["id", "Name", "city", "state_or_country"] - _default_display_names = {"id": "ID", - "Name": "Name", - "city": "City", - "state_or_country": "State/Country"} - _default_display_types = {} - _required = ['Creator', - 'Identifier', - 'Type'] _properties = PgefObject._properties.copy() _schema = OntoClass( id='Organization', @@ -130,6 +121,7 @@ id_context='PanGalactic', name='City', pgef_datatype='str', + default_display='True', description=""" The organization's city. (From the CAGE data structure.) @@ -139,6 +131,7 @@ id_context='PanGalactic', name='State or Country', pgef_datatype='str', + default_display='True', description=""" The organization's state (if in the U.S.) or country. (From the CAGE data structure.) @@ -166,6 +159,7 @@ id_context='PanGalactic', name='Parent Organization', pgef_datatype='str', + default_display='True', description=""" The organization's parent organization's CAGE code. (From the CAGE data structure.) Index: PanGalactic/pangalactic/enterprise/model.py diff -u PanGalactic/pangalactic/enterprise/model.py:1.10 PanGalactic/pangalactic/enterprise/model.py:1.11 --- PanGalactic/pangalactic/enterprise/model.py:1.10 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/model.py Wed Aug 11 02:21:09 2004 @@ -1,12 +1,12 @@ -# $Id: model.py,v 1.10 2004/08/09 01:35:39 waterbug Exp $ +# $Id: model.py,v 1.11 2004/08/11 06:21:09 waterbug Exp $ """ A representation or specification of a thing. -@version: $Revision: 1.10 $ +@version: $Revision: 1.11 $ """ -__version__ = "$Revision: 1.10 $"[11:-2] +__version__ = "$Revision: 1.11 $"[11:-2] from pangalactic.enterprise.versionedobject import VersionedObject from pangalactic.meta.ontoclass import OntoClass @@ -17,14 +17,7 @@ A representation or specification of a Thing (the Thing may or may not be a Part). """ - _default_display_order = ["id", "name", "description", "owner"] - _default_display_names = {"id": "Model", - "name": "Model Name Code", - "description": "Model Name", - "owner": "Model Owner"} - _default_display_types = {} _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] - _required = ['id', 'name'] _schema = OntoClass( id='Model', id_context='PanGalactic', Index: PanGalactic/pangalactic/enterprise/part.py diff -u PanGalactic/pangalactic/enterprise/part.py:1.9 PanGalactic/pangalactic/enterprise/part.py:1.10 --- PanGalactic/pangalactic/enterprise/part.py:1.9 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/part.py Wed Aug 11 02:21:09 2004 @@ -1,4 +1,4 @@ -# $Id: part.py,v 1.9 2004/08/09 01:35:39 waterbug Exp $ +# $Id: part.py,v 1.10 2004/08/11 06:21:09 waterbug Exp $ """ A Part is a product or some specifiable thing. @@ -7,7 +7,7 @@ specification, or description. It may be versioned. """ -__version__ = "$Revision: 1.9 $"[11:-2] +__version__ = "$Revision: 1.10 $"[11:-2] from pangalactic.enterprise.versionedobject import VersionedObject from pangalactic.meta.ontoclass import OntoClass @@ -22,24 +22,9 @@ """ # These are the fields that will appear in when an item is placed in a grid. # The format for each field is [ Label, attribute, field_type ]. - _default_display_order = ["id", - "name", - "owner", - "description", - "create_datetime", - "creator"] - _default_display_names = {"id": "Part Number", - "name": "Name", - "owner": "POC", - "description": "Description", - "create_datetime": "Created", - "creator": "Creator"} - _default_display_types = {} _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] - _required = ['id', - 'id_context'] _schema = OntoClass( id='Part', id_context='PanGalactic', @@ -61,6 +46,7 @@ id_context='PanGalactic', name='Specification Part Number', pgef_datatype='str', + default_display='True', description=""" The identifier for the Part given by its specification. @@ -70,6 +56,7 @@ id_context='PanGalactic', name='Generic Part Number', pgef_datatype='str', + default_display='True', description=""" The generic identifier for the Part, which in some cases is specified by a standard (e.g., JEDEC for @@ -123,6 +110,7 @@ id_context='PanGalactic', name='Manufacturer', pgef_datatype='str', + default_display='True', description=""" The CAGE Code of the Organization's plant or location where the Part was manufactured. @@ -132,6 +120,7 @@ id_context='PanGalactic', name='Manufacturer Name Code', pgef_datatype='str', + default_display='True', description=""" A standard abbreviation for the parent Organization of the plant or location where the Part was @@ -161,6 +150,7 @@ id_context='PanGalactic', name='FSC Code', pgef_datatype='str', + default_display='True', description=""" The Federal Supply Classification code for the Part (this is also the first four digits of the Index: PanGalactic/pangalactic/utils/pgefdatatable.py diff -u PanGalactic/pangalactic/utils/pgefdatatable.py:1.15 PanGalactic/pangalactic/utils/pgefdatatable.py:1.16 --- PanGalactic/pangalactic/utils/pgefdatatable.py:1.15 Mon Jul 12 15:33:11 2004 +++ PanGalactic/pangalactic/utils/pgefdatatable.py Wed Aug 11 02:21:11 2004 @@ -238,14 +238,9 @@ """ # print "table.sortcolumn", col_ndx # print "displaymap", self.display_map -# self._data[0]._default_display_names[self._data[0]._default_display_order[col]] -# name = self.colnames[col] _data = [] -# foo = self._data[0]._display_order[col_ndx] foo = self.identifiers[col_ndx] for row in self._data: -# rowname, entry = row -# _data.append((entry.get(name, None), row)) _data.append((getattr(row, foo), row)) _data.sort() Index: PanGalactic/pangalactic/enterprise/person.py diff -u PanGalactic/pangalactic/enterprise/person.py:1.22 PanGalactic/pangalactic/enterprise/person.py:1.23 --- PanGalactic/pangalactic/enterprise/person.py:1.22 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/person.py Wed Aug 11 02:21:09 2004 @@ -1,4 +1,4 @@ -# $Id: person.py,v 1.22 2004/08/09 01:35:39 waterbug Exp $ +# $Id: person.py,v 1.23 2004/08/11 06:21:09 waterbug Exp $ """ A human being. @@ -13,26 +13,8 @@ A human being (who may or may not be a PanGalactic application user). """ - _default_display_order = ["lname", - "fname", - "mi_or_name", - "pgef_oid", - "position_title", - "enabled_flag"] - _default_display_names = {"lname" : "Last Name", - "fname" : "First Name", - "mi_or_name" : "M.I./Name", - "pgef_oid" : "UserID", - "position_title" : "Title/Position", - "enabled_flag": "Enabled"} - _default_display_types = {} _excluded_fields = [] _properties = PgefObject._properties.copy() - _required = ['id', - 'fname', - 'lname', - 'email', - 'phone'] _schema=OntoClass( id='Person', id_context='PanGalactic', @@ -61,6 +43,7 @@ id_context='PanGalactic', name='First Name', pgef_datatype='str', + default_display='True', description=""" The Person's first (given) name. """), @@ -69,6 +52,7 @@ id_context='PanGalactic', name='Middle Initial or Name', pgef_datatype='str', + default_display='True', description=""" The Person's middle initial or name. """), @@ -77,6 +61,7 @@ id_context='PanGalactic', name='Last Name', pgef_datatype='str', + default_display='True', description=""" The Person's last name (surname). """), Index: PanGalactic/pangalactic/enterprise/partslist.py diff -u PanGalactic/pangalactic/enterprise/partslist.py:1.23 PanGalactic/pangalactic/enterprise/partslist.py:1.24 --- PanGalactic/pangalactic/enterprise/partslist.py:1.23 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/partslist.py Wed Aug 11 02:21:09 2004 @@ -1,11 +1,11 @@ -# $Id: partslist.py,v 1.23 2004/08/09 01:35:39 waterbug Exp $ +# $Id: partslist.py,v 1.24 2004/08/11 06:21:09 waterbug Exp $ """ A Document consisting of a collection of references to Parts and associated data. """ -__version__ = "$Revision: 1.23 $"[11:-2] +__version__ = "$Revision: 1.24 $"[11:-2] from pangalactic.enterprise.document import Document from pangalactic.meta.ontoclass import OntoClass @@ -16,16 +16,10 @@ A Document consisting of a collection of references to Parts and associated data. """ - _default_display_order = ["id", "owner", "version"] - _default_display_names = {"id": "Parts List ID", - "owner": "Point of Contact", - "version": "Version"} _excluded_fields = [] _properties = {'PointofContact' : 'str', 'Identifier' : 'str', 'Type' : 'str'} - _required = ['PointofContact', - 'Identifier'] _schema = OntoClass( id='PartsList', id_context='PanGalactic', @@ -47,6 +41,7 @@ id_context='PanGalactic', name='Parts List Type', pgef_datatype='str', + default_display='True', description=""" The type of the PartsList, selected from a set of standard parts list types, such as 'as-designed' Index: PanGalactic/pangalactic/enterprise/pgefrepresentation.py diff -u PanGalactic/pangalactic/enterprise/pgefrepresentation.py:1.1 PanGalactic/pangalactic/enterprise/pgefrepresentation.py:1.2 --- PanGalactic/pangalactic/enterprise/pgefrepresentation.py:1.1 Sun Aug 8 21:37:27 2004 +++ PanGalactic/pangalactic/enterprise/pgefrepresentation.py Wed Aug 11 02:21:09 2004 @@ -1,14 +1,14 @@ -# $Id: pgefrepresentation.py,v 1.1 2004/08/09 01:37:27 waterbug Exp $ +# $Id: pgefrepresentation.py,v 1.2 2004/08/11 06:21:09 waterbug Exp $ """ A PGEF Representation is a relationship between one or more PgefObjects (its 'objects' property) and one or more PgefFiles (its 'files' property) that contain(s) a serialization of the object(s). -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -20,17 +20,7 @@ (its 'objects' property) and one or more PgefFiles (its 'files' property) that contain(s) a serialization of the object(s). """ - _default_display_order = ["objects", - "files", - "id", - "owner", - "creator"] - _default_display_names = {"objects" : "Objects", - "files" : "Files", - "id" : "Owner", - "owner" : "Creator"} _properties = PgefObject._properties.copy() - _required = ['objects', 'files'] _schema = OntoClass( id='PgefRepresentation', id_context='PanGalactic', @@ -64,6 +54,7 @@ name='RepresentationType', display_name='Representation Type', pgef_datatype='str', + default_display='True', description=""" [pgef:name] (This definition overrides the generic definition inherited from PgefObject.) A set of representation names can @@ -108,6 +99,7 @@ name='RepresentationRole', display_name='Representation Role', pgef_datatype='str', + default_display='True', description=""" [pgef:rep_role] The purpose or meaning of this representation -- e.g. "attachment", "content", "stylesheet", "DTD", @@ -119,6 +111,7 @@ id_context='PanGalactic', name='Generable', pgef_datatype='bool', + default_display='True', description=""" [pgef:generable] Able to be generated from the objects. """), @@ -127,6 +120,7 @@ id_context='PanGalactic', name='Composable', pgef_datatype='bool', + default_display='True', description=""" [pgef:composable] Able to be used (e.g., by an editor or a parser/importer) to construct the objects. @@ -137,6 +131,7 @@ name='IsOrigin', display_name='Is Origin', pgef_datatype='bool', + default_display='True', description=""" [pgef:is_origin] Indicates whether this representation is the original source of this object or set of objects in PGER or in Index: PanGalactic/pangalactic/client/tests/test_pgefobject.py diff -u PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.14 PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.15 --- PanGalactic/pangalactic/client/tests/test_pgefobject.py:1.14 Tue Aug 10 12:13:39 2004 +++ PanGalactic/pangalactic/client/tests/test_pgefobject.py Wed Aug 11 02:21:09 2004 @@ -47,11 +47,10 @@ Check to make sure that if all required fields are not filled in that we receive an exception """ - self.obj1._required = [] - self.obj1._required.append('test_name') - self.obj1.test_name = '' - self.assertRaises(pgefexceptions.RequiredDataError, self.obj1.validate) - self.obj1._required.remove('test_name') + # TODO: + # This needs to be rewritten to check properties that have + # min_cardinality > 0. + pass def testBuild(self): self.obj1 = pgefobject.PgefObject() Index: PanGalactic/pangalactic/enterprise/project.py diff -u PanGalactic/pangalactic/enterprise/project.py:1.24 PanGalactic/pangalactic/enterprise/project.py:1.25 --- PanGalactic/pangalactic/enterprise/project.py:1.24 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/project.py Wed Aug 11 02:21:09 2004 @@ -1,12 +1,12 @@ -# $Id: project.py,v 1.24 2004/08/09 01:35:39 waterbug Exp $ +# $Id: project.py,v 1.25 2004/08/11 06:21:09 waterbug Exp $ """ A specific, identifiable activity of Organizations and Persons. -@version: $Revision: 1.24 $ +@version: $Revision: 1.25 $ """ -__version__ = "$Revision: 1.24 $"[11:-2] +__version__ = "$Revision: 1.25 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -16,24 +16,11 @@ """ A specific, identifiable activity of Organizations and Persons. """ - _default_display_order = ["id", - "name", - "owner", - "description", - "create_datetime", - "creator"] - _default_display_names = {"id": "Project Acronym", - "name": "Project Name", - "owner": "POC", - "description": "Description", - "create_datetime": "Created", - "creator": "Creator"} _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] # These are the minimum fields that must be filled in before # a Project can be saved. - _required = ['name', 'id', 'id_context'] _schema = OntoClass( id='Project', id_context='PanGalactic', Index: PanGalactic/pangalactic/enterprise/personrole.py diff -u PanGalactic/pangalactic/enterprise/personrole.py:1.1 PanGalactic/pangalactic/enterprise/personrole.py:1.2 --- PanGalactic/pangalactic/enterprise/personrole.py:1.1 Sun Aug 8 21:37:26 2004 +++ PanGalactic/pangalactic/enterprise/personrole.py Wed Aug 11 02:21:09 2004 @@ -1,10 +1,10 @@ -# $Id: personrole.py,v 1.1 2004/08/09 01:37:26 waterbug Exp $ +# $Id: personrole.py,v 1.2 2004/08/11 06:21:09 waterbug Exp $ """ A Person in a Role. """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -18,7 +18,6 @@ 'create_datetime', 'mod_datetime'] _properties = {} - _required = [] _schema = OntoClass( id='PersonRole', id_context='PanGalactic', Index: PanGalactic/pangalactic/client/tests/test_person.py diff -u PanGalactic/pangalactic/client/tests/test_person.py:1.10 PanGalactic/pangalactic/client/tests/test_person.py:1.11 --- PanGalactic/pangalactic/client/tests/test_person.py:1.10 Sun Aug 8 22:53:46 2004 +++ PanGalactic/pangalactic/client/tests/test_person.py Wed Aug 11 02:21:09 2004 @@ -58,7 +58,8 @@ #assert len(self.obj1.gridmap) > 0, 'Missing data in Item.gridmap' def testRequiredList(self): - assert len(self.obj1._required) > 0, 'Missing required fields in Item._required' + # TODO: test for properties that have min_cardinality > 0. + pass def suite(): user_suite = unittest.TestSuite() Index: PanGalactic/pangalactic/enterprise/mime.py diff -u PanGalactic/pangalactic/enterprise/mime.py:1.1 PanGalactic/pangalactic/enterprise/mime.py:1.2 --- PanGalactic/pangalactic/enterprise/mime.py:1.1 Sun Aug 8 21:37:26 2004 +++ PanGalactic/pangalactic/enterprise/mime.py Wed Aug 11 02:21:09 2004 @@ -1,10 +1,10 @@ -# $Id: mime.py,v 1.1 2004/08/09 01:37:26 waterbug Exp $ +# $Id: mime.py,v 1.2 2004/08/11 06:21:09 waterbug Exp $ """ Multi-purpose Internet Mail Extension (MIME) type. """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] import string from pangalactic.enterprise.pgefobject import PgefObject @@ -19,7 +19,6 @@ 'create_datetime', 'mod_datetime'] _properties = {'mime_type' : 'str'} - _required = [] _schema = OntoClass( id='Mime', id_context='PanGalactic', Index: PanGalactic/pangalactic/enterprise/pgeffile.py diff -u PanGalactic/pangalactic/enterprise/pgeffile.py:1.25 PanGalactic/pangalactic/enterprise/pgeffile.py:1.26 --- PanGalactic/pangalactic/enterprise/pgeffile.py:1.25 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/pgeffile.py Wed Aug 11 02:21:09 2004 @@ -1,4 +1,4 @@ -# $Id: pgeffile.py,v 1.25 2004/08/09 01:35:39 waterbug Exp $ +# $Id: pgeffile.py,v 1.26 2004/08/11 06:21:09 waterbug Exp $ """ PgefFile is a logical proxy for a system file, including @@ -9,10 +9,10 @@ Model, or Document, and the file may have relationships to more than one such object. -@version: $Revision: 1.25 $ +@version: $Revision: 1.26 $ """ -__version__ = "$Revision: 1.25 $"[11:-2] +__version__ = "$Revision: 1.26 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -29,7 +29,6 @@ relationships to more than one such object. """ _excluded_fields = [] - _required = [] _schema=OntoClass( id='PgefFile', id_context='PanGalactic', Index: PanGalactic/pangalactic/client/tests/test_partslist.py diff -u PanGalactic/pangalactic/client/tests/test_partslist.py:1.13 PanGalactic/pangalactic/client/tests/test_partslist.py:1.14 --- PanGalactic/pangalactic/client/tests/test_partslist.py:1.13 Tue Jun 15 01:32:35 2004 +++ PanGalactic/pangalactic/client/tests/test_partslist.py Wed Aug 11 02:21:09 2004 @@ -36,7 +36,8 @@ # assert len(self.obj1._gridmap) > 0, 'Missing data in Partslist._gridmap' def testRequiredList(self): - assert len(self.obj1._required) > 0, 'Missing required fields in Partslist._required' + # TODO: check properties with min_cardinality > 0. + pass def suite(): Index: PanGalactic/pangalactic/enterprise/pgefrole.py diff -u PanGalactic/pangalactic/enterprise/pgefrole.py:1.1 PanGalactic/pangalactic/enterprise/pgefrole.py:1.2 --- PanGalactic/pangalactic/enterprise/pgefrole.py:1.1 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/pgefrole.py Wed Aug 11 02:21:09 2004 @@ -1,11 +1,11 @@ -# $Id: pgefrole.py,v 1.1 2004/08/09 01:35:39 waterbug Exp $ +# $Id: pgefrole.py,v 1.2 2004/08/11 06:21:09 waterbug Exp $ """ A user role, which typically will have an associated set of privileges. """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -20,7 +20,6 @@ 'create_datetime', 'mod_datetime'] _properties = {} - _required = [] _schema = OntoClass( id='PgefRole', id_context='PanGalactic', Index: PanGalactic/pangalactic/enterprise/versionedobject.py diff -u PanGalactic/pangalactic/enterprise/versionedobject.py:1.14 PanGalactic/pangalactic/enterprise/versionedobject.py:1.15 --- PanGalactic/pangalactic/enterprise/versionedobject.py:1.14 Sun Aug 8 21:35:39 2004 +++ PanGalactic/pangalactic/enterprise/versionedobject.py Wed Aug 11 02:21:09 2004 @@ -1,11 +1,11 @@ -# $Id: versionedobject.py,v 1.14 2004/08/09 01:35:39 waterbug Exp $ +# $Id: versionedobject.py,v 1.15 2004/08/11 06:21:09 waterbug Exp $ """ A thing which evolves in a set of discrete, identified incarnations. """ -__version__ = "$Revision: 1.14 $"[11:-2] +__version__ = "$Revision: 1.15 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -19,7 +19,6 @@ _excluded_fields = ['create_datetime', 'pger_create_datetime', 'pgef_oid'] - _required = [] _schema = OntoClass( id='VersionedObject', id_context='PanGalactic', @@ -58,6 +57,7 @@ id_context='PanGalactic', name='Version', pgef_datatype='str', + default_display='True', description=""" A user-modifiable string used to identify a baseline, release, or version. @@ -68,6 +68,7 @@ name='HEAD', pgef_datatype='bool', default='True', + default_display='True', description=""" This flag is set to True for a VersionedObject committed as a new version (and unset on the previous head VersionedObject @@ -79,6 +80,7 @@ name='Project', pgef_datatype='Project', property_type='object', + default_display='True', description=""" The Project under which the Part was created (if applicable -- if not applicable, the defaults are used). Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.65 PanGalactic/pangalactic/enterprise/pgefobject.py:1.66 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.65 Tue Aug 10 15:07:18 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Wed Aug 11 02:21:09 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.65 2004/08/10 19:07:18 waterbug Exp $ +# $Id: pgefobject.py,v 1.66 2004/08/11 06:21:09 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.65 $ +@version: $Revision: 1.66 $ """ -__version__ = "$Revision: 1.65 $"[11:-2] +__version__ = "$Revision: 1.66 $"[11:-2] import types import string @@ -48,13 +48,6 @@ - C{{ attr_name : pgef_datatype, ... }} - @type _excluded_fields_ext: list - @cvar _excluded_fields_ext: attributes introduced in the - subclass that are excluded from the isEqual and isEmpty - methods. The _excluded_fields attribute of the subclass - is formed by combining this with the _excluded_fields - attribute(s) of its superclass(es). - @type _excluded_fields: list @cvar _excluded_fields: attributes excluded from the isEqual and isEmpty methods. These are basically any attributes @@ -70,10 +63,6 @@ - C{{ attr_name : pgef_datatype, ... }} - @type _required: list - @cvar _required: attributes that must be populated with - non-empty values - @type _schema: OntoClass @cvar _schema: defines the persistable attributes of a domain object, whose Python class will be an instance of @@ -92,7 +81,6 @@ 'mod_datetime' ] _properties = {} - _required = [] _schema = OntoClass( id='PgefObject', id_context='PanGalactic', @@ -351,9 +339,6 @@ formats, etc. """) ]) # end of _schema - _default_display_order = _schema._default_display_order - _default_display_names = _schema._default_display_names - _default_display_types = _schema._default_display_types def __init__(self, **kw): @@ -380,9 +365,10 @@ self.create_datetime = DateTime.now() self.mod_datetime = DateTime.now() self._display_map = [] - self._display_order = copy.copy(self._default_display_order) + self._display_order = copy.copy(self._schema._default_display_order) # TODO: generate these from the OntoProperty.display_name's - self._display_names = self._default_display_names.copy() + self._display_names = self._schema._default_display_names.copy() + self._display_types = self._schema._default_display_types.copy() # populate Python properties, if settable and passed in as kw's for a in kw: if a in self._properties: @@ -399,34 +385,34 @@ display_types mapping. """ #print "pgefobject.getdisplaymap" - attr_names = self.__dict__.keys() + attr_names = [p.id for p in self._schema.properties] labels = [(attr_name, attr_name.replace("_", " ").title().strip()) for attr_name in attr_names] - if not self._default_display_names: - self._default_display_names = dict(labels) + if not self._schema._default_display_names: + self._schema._default_display_names = dict(labels) - if not self._default_display_order: + if not self._schema._default_display_order: labels.sort(utils.compareSequence1) - self._default_display_order = [label[0] for label in labels] + self._schema._default_display_order = [label[0] for label in labels] - if not self._default_display_types: + if not self._schema._default_display_types: attr_types = [(attr_name, "string") for attr_name in attr_names] - self._default_display_types = dict(attr_types) + self._schema._default_display_types = dict(attr_types) for attr_name, attr_type in attr_types: obj = self.__dict__[attr_name] if isinstance(obj, PgefObject): - self._default_display_types[attr_name] = obj.name + self._schema._default_display_types[attr_name] = obj.name if not dnames: - dnames = self._default_display_names + dnames = self._schema._default_display_names if not dorder: - dorder = self._default_display_order + dorder = self._schema._default_display_order if not dtypes: - dtypes = self._default_display_types + dtypes = self._schema._default_display_types - self._display_order = copy.copy(self._default_display_order) - self._display_names = self._default_display_names.copy() - self._display_types = self._default_display_types.copy() + self._display_order = copy.copy(self._schema._default_display_order) + self._display_names = self._schema._default_display_names.copy() + self._display_types = self._schema._default_display_types.copy() return [[x, dnames.get(x, x), dtypes.get(x, "string")] for x in dorder] @@ -453,9 +439,9 @@ del self._display_names[attrname] def resetDefaultDisplay(self): - self._display_order = copy.copy(self._default_display_order) - self._display_names = self._default_display_names.copy() - self._display_types = self._default_display_types.copy() + self._display_order = copy.copy(self._schema._default_display_order) + self._display_names = self._schema._default_display_names.copy() + self._display_types = self._schema._default_display_types.copy() def set_string_date(self, value): raise TypeError, 'Attribute cannot be set' @@ -619,22 +605,18 @@ def validate(self): """ - Validate the internal data members against the names in - the _required attribute; if all are valid, return True; - if not, raise a RequiredDataError. - """ - for a in self._required: - if a in self._properties: - value = getattr(self, a) - else: - value = self.__dict__[a] - - if type(value) == types.InstanceType: - pass - elif value == "" or value == None: - msg = ("Missing data in " - + self.__class__.__name__ + "." + a) - print "msg", msg + Validate that properties with min_cardinality > 0 have been + populated; if all are populated, return True; if not, raise a + RequiredDataError. + """ + required = [p.id for p in filter( + lambda x: bool(getattr(p, 'min_cardinality', 0)), + self._schema.properties)] + for a in required: + val = getattr(self, a, None) + if value == None: + msg = ''.join(["Missing data in ", + self._schema.id, ".", a]) raise pgefexceptions.RequiredDataError, msg return True Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.104 PanGalactic/pangalactic/utils/localdb.py:1.105 --- PanGalactic/pangalactic/utils/localdb.py:1.104 Tue Aug 10 12:13:41 2004 +++ PanGalactic/pangalactic/utils/localdb.py Wed Aug 11 02:21:11 2004 @@ -244,72 +244,15 @@ def defaultDisplayConfig(self): #print "localdb.defaultdisplayconfig" current_config = {} - for cn in self._registry.pgef_classes: - klass = self._registry.pgef_classes[cn] - current_config[cn] = self.getDefaultDisplayMap( - klass._default_display_names, - klass._default_display_order, - klass._default_display_types) -# current_config["Acu"] = \ -# self.getDefaultDisplayMap(Acu._default_display_names, -# Acu._default_display_order, -# Acu._default_display_types) -# current_config["Dcu"] = \ -# self.getDefaultDisplayMap(Dcu._default_display_names, -# Dcu._default_display_order, -# Dcu._default_display_types) -# current_config["Document"] = \ -# self.getDefaultDisplayMap(Document._default_display_names, -# Document._default_display_order, -# Document._default_display_types) -# current_config["Model"] = \ -# self.getDefaultDisplayMap(Model._default_display_names, -# Model._default_display_order, -# Model._default_display_types) -# current_config["OntoClass"] = \ -# self.getDefaultDisplayMap(OntoClass._default_display_names, -# OntoClass._default_display_order, -# OntoClass._default_display_types) -# current_config["OntoProperty"] = \ -# self.getDefaultDisplayMap(OntoProperty._default_display_names, -# OntoProperty._default_display_order, -# OntoProperty._default_display_types) -# current_config["Organization"] = \ -# self.getDefaultDisplayMap(Organization._default_display_names, -# Organization._default_display_order, -# Organization._default_display_types) -# current_config["Part"] = \ -# self.getDefaultDisplayMap(Part._default_display_names, -# Part._default_display_order, -# Part._default_display_types) -# current_config["PartsList"] = \ -# self.getDefaultDisplayMap(PartsList._default_display_names, -# PartsList._default_display_order, -# PartsList._default_display_types) -# current_config["Person"] = \ -# self.getDefaultDisplayMap(Person._default_display_names, -# Person._default_display_order, -# Person._default_display_types) -# current_config["PgefFile"] = \ -# self.getDefaultDisplayMap(PgefFile._default_display_names, -# PgefFile._default_display_order, -# PgefFile._default_display_types) -# current_config["PgefObject"] = \ -# self.getDefaultDisplayMap(PgefObject._default_display_names, -# PgefObject._default_display_order, -# PgefObject._default_display_types) -# current_config["Project"] = \ -# self.getDefaultDisplayMap(Project._default_display_names, -# Project._default_display_order, -# Project._default_display_types) -# current_config["PgefRole"] = \ -# self.getDefaultDisplayMap(PgefRole._default_display_names, -# PgefRole._default_display_order, -# PgefRole._default_display_types) -# current_config["User"] = \ -# self.getDefaultDisplayMap(Person._default_display_names, -# Person._default_display_order, -# Person._default_display_types) + for ocid in self._registry.onto_classes: + oc = self._registry.onto_classes[ocid] + current_config[ocid] = self.getDefaultDisplayMap( + oc._default_display_names, + oc._default_display_order, + oc._default_display_types) + +######### TODO: define OntoClass instances for the Wf classes!! +# # current_config["WfActivity"] = \ # self.getDefaultDisplayMap(WfActivity._default_display_names, # WfActivity._default_display_order, Index: PanGalactic/pangalactic/utils/pgefexceptions.py diff -u PanGalactic/pangalactic/utils/pgefexceptions.py:1.4 PanGalactic/pangalactic/utils/pgefexceptions.py:1.5 --- PanGalactic/pangalactic/utils/pgefexceptions.py:1.4 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/pgefexceptions.py Wed Aug 11 02:21:11 2004 @@ -1,8 +1,8 @@ """PGEF-specific exception classes.""" -# $Id: pgefexceptions.py,v 1.4 2004/08/09 01:41:24 waterbug Exp $ +# $Id: pgefexceptions.py,v 1.5 2004/08/11 06:21:11 waterbug Exp $ -__version__ = "$Revision: 1.4 $"[11:-2] +__version__ = "$Revision: 1.5 $"[11:-2] class PgefError(Exception): """Parent of PGEF exception classes""" @@ -10,10 +10,10 @@ Exception.__init__(self) self.value = value -class RequiredDataError(PgefError): +class RequiredDataError(ValueError): """Raised when required data is missing""" - def __init__(self, value=None): - PgefError.__init__(self, value=value) + def __init__(self, value): + ValueError.__init__(self, value) class InvalidLogin(PgefError): """Raised for invalid logins""" From waterbug at ned.gsfc.nasa.gov Wed Aug 11 10:20:38 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 11 10:20:40 2004 Subject: [Pangalactic-commits] Display defaults and maps work (yay! :) Message-ID: <200408111420.i7BEKcbV023767@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.108 1.109 PanGalactic/pangalactic/utils/datamanager.py 1.135 1.136 PanGalactic/pangalactic/utils/objectviewer.py 1.4 1.5 Log message: Display defaults and maps work (yay! :) Index: PanGalactic/pangalactic/utils/objectviewer.py diff -u PanGalactic/pangalactic/utils/objectviewer.py:1.4 PanGalactic/pangalactic/utils/objectviewer.py:1.5 --- PanGalactic/pangalactic/utils/objectviewer.py:1.4 Wed Jun 30 16:47:17 2004 +++ PanGalactic/pangalactic/utils/objectviewer.py Wed Aug 11 10:20:36 2004 @@ -14,7 +14,8 @@ class ObjectViewer(toolframe.toolFrame): def __init__(self, parent, id, obj, size): title = "Attributes for: " + obj.__class__.__name__ - toolframe.toolFrame.__init__(self, parent, -1, title, wxDefaultPosition, size = size) + toolframe.toolFrame.__init__(self, parent, -1, title, + wxDefaultPosition, size=size) self.num_attrs = len(obj.__dict__) self.ObjectGuiFunc(True) @@ -91,8 +92,9 @@ def OnSelectCell(self, event): - # print "OnSelectCell: (%d,%d) %s\n" % (event.GetRow(), event.GetCol(), event.GetPosition()) - + # print "OnSelectCell: (%d,%d) %s\n" % (event.GetRow(), + # event.GetCol(), + # event.GetPosition()) self.SelectedRow = event.GetRow() # self.ObjGrid.SelectRow(self.SelectedRow) self.MoveTo = self.SelectedRow, self.LeftCol @@ -107,17 +109,23 @@ def OnEditorShown(self, event): - # print "OnEditorShown: (%d,%d) %s\n" % (event.GetRow(), event.GetCol(), event.GetPosition()) + # print "OnEditorShown: (%d,%d) %s\n" % (event.GetRow(), + # event.GetCol(), + # event.GetPosition()) event.Skip() def OnEditorHidden(self, event): - #print "OnEditorHidden: (%d,%d) %s\n" % (event.GetRow(), event.GetCol(), event.GetPosition()) + # print "OnEditorHidden: (%d,%d) %s\n" % (event.GetRow(), + # event.GetCol(), + # event.GetPosition()) event.Skip() def OnEditorCreated(self, event): - # print "OnEditorCreated: (%d, %d) %s\n" % (event.GetRow(), event.GetCol(), event.GetControl()) + # print "OnEditorCreated: (%d, %d) %s\n" % (event.GetRow(), + # event.GetCol(), + # event.GetControl()) event.Skip() @@ -129,7 +137,9 @@ def OnCellChange(self, event): - # print "OnCellChange: (%d,%d) %s\n" % (event.GetRow(), event.GetCol(), event.GetPosition()) + # print "OnCellChange: (%d,%d) %s\n" % (event.GetRow(), + # event.GetCol(), + # event.GetPosition()) self.SelectedRow = event.GetRow() event.Skip() @@ -152,20 +162,19 @@ def SetData(self, obj): print "NOTE: objectviewer.setdata.default_display_xxx can't handle schema attrs yet" - attrs = obj.__dict__.keys() - for a in obj._schema: - if a not in attrs: - attrs.append(a) - self.ObjGrid.AppendRows(1) - + attrs = [p.id for p in obj._schema.properties] + for a in attrs: + self.ObjGrid.AppendRows(1) # fabricate the firstcap attribute names for display - pretty_labels = [(attr_name.replace("_", " ").title().strip(), attr_name) for attr_name in attrs] + pretty_labels = [(attr_name.replace("_", " ").title().strip(), + attr_name) for attr_name in attrs] pretty_labels.sort() attr_row = 0 for left, a in pretty_labels: if isinstance(getattr(obj, a), PgefObject): - right = "%s (pgef_oid = %s)" % (repr(getattr(obj, a)), getattr(obj, a).pgef_oid) + right = "%s (pgef_oid = %s)" % (repr(getattr(obj, a)), + getattr(obj, a).pgef_oid) else: right = str(getattr(obj, a)) self.ObjGrid.SetCellValue(attr_row, self.LeftCol, left) @@ -181,3 +190,4 @@ def onClose(self, event): self.Show(False) + Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.108 PanGalactic/pangalactic/client/fnord.py:1.109 --- PanGalactic/pangalactic/client/fnord.py:1.108 Tue Aug 10 12:13:38 2004 +++ PanGalactic/pangalactic/client/fnord.py Wed Aug 11 10:20:36 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.108 2004/08/10 16:13:38 waterbug Exp $ +# $Id: fnord.py,v 1.109 2004/08/11 14:20:36 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.108 $ +@version: $Revision: 1.109 $ """ -__version__ = "$Revision: 1.108 $"[11:-2] +__version__ = "$Revision: 1.109 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -253,10 +253,12 @@ preferences.LoadPreferences(1) showloginconfirm = prefs.get('ShowLoginConfirmation', True) - self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, int(showloginconfirm)) - + self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, + int(showloginconfirm)) + if not prefs.get('userid', None): - dlg = wxDialog(self, -1, "Required information missing", size=wxSize(350, 200), style=wxCAPTION) + dlg = wxDialog(self, -1, "Required information missing", + size=wxSize(350, 200), style=wxCAPTION) sizer = wxBoxSizer(wxVERTICAL) label = wxStaticText(dlg, -1, "Username:") @@ -290,19 +292,24 @@ preferences.CreatePreferencesFile(prefs) dlg.Destroy() - useroid = (prefs.get('email', None) or - prefs.get('userid', 'newbie')), + useroid = prefs.get('email', + None) or prefs.get('userid', + 'newbie') + print 'fnord: useroid =', useroid self.user = Person(pgef_oid=useroid, id=prefs.get('userid', useroid), email=prefs.get('email', 'local')) + print 'fnord: user =' + print self.user oid.setOidBase(useroid) self.State.currentprojectname = ( prefs.get('lastproject', None) or prefs.get('defaultproject', 'NOPROJECT')) + print 'fnord: current project =', self.State.currentprojectname self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=self.State.currentprojectname) - self.ActivateTool() + self.activateTool() self.OnServerCombo() show_tooltips = prefs.get("ShowToolTips", False) if show_tooltips: @@ -778,11 +785,13 @@ def OnDBBrowser(self, event): #print "fnord.ondbbrowser" tmpsize = wxSize(750, 500) - dbb_frame = toolframe.toolFrame(self, -1, 'Local Database Browser', wxDefaultPosition, tmpsize) + dbb_frame = toolframe.toolFrame(self, -1, 'Local Database Browser', + wxDefaultPosition, tmpsize) dbb_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') - dbb_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") + dbb_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") dbb_frame.mainpanel = dbbrowser.zodbbrowser(dbb_frame, -1, - localdb = self.dm.localDB) + localdb=self.dm.localDB) config_access = self.dm.getConfigAccess() dbb_frame.mainpanel.FillChoice(config_access) dbb_frame.CentreOnParent() @@ -920,7 +929,7 @@ def OnLogin(self, event): - #print "fnord.onlogin" + print "fnord.onlogin" loginconfirm = prefs.get('ShowLoginConfirmation', None) dialog = LoginClass(self, -1, "PGEF Login" ) if loginconfirm == None: @@ -1048,8 +1057,8 @@ event.Skip() dlg.Destroy() - def ActivateTool(self): - #print "fnord.activatetool", self.State + def activateTool(self): + print "fnord.activateTool", self.State if self.psmtool and self.psmtool.IsShown(): return @@ -1063,7 +1072,7 @@ def OnActivateTool (self, event): self.sb.ClearMsg() - self.ActivateTool() + self.activateTool() def InitializeTool(self): Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.135 PanGalactic/pangalactic/utils/datamanager.py:1.136 --- PanGalactic/pangalactic/utils/datamanager.py:1.135 Tue Aug 10 15:07:19 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Wed Aug 11 10:20:36 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.135 $ +@version: $Revision: 1.136 $ """ -__version__ = "$Revision: 1.135 $"[11:-2] +__version__ = "$Revision: 1.136 $"[11:-2] import time import mx.DateTime @@ -34,6 +34,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils.httpupload import upload from pangalactic.utils.pgefexceptions import LocalStorageError +from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.xmlrpcinterface import XmlrpcInterface prefs = preferences.prefs @@ -115,8 +116,6 @@ secure=secure, domains=self.domains, _registry=self._registry) - - def getRoot(self): From waterbug at ned.gsfc.nasa.gov Wed Aug 11 13:44:31 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 11 13:44:33 2004 Subject: [Pangalactic-commits] Move pgefstate to utils; make it Borg. ;) Message-ID: <200408111744.i7BHiVSf026584@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.109 1.110 PanGalactic/pangalactic/client/pgefstate.py 1.2 None PanGalactic/pangalactic/utils/pgefstate.py None 1.1 PanGalactic/pangalactic/utils/basegrid.py 1.34 1.35 PanGalactic/pangalactic/utils/datamanager.py 1.136 1.137 PanGalactic/pangalactic/utils/pgefdatatable.py 1.16 1.17 Log message: Move pgefstate to utils; make it Borg. ;) Index: PanGalactic/pangalactic/utils/basegrid.py diff -u PanGalactic/pangalactic/utils/basegrid.py:1.34 PanGalactic/pangalactic/utils/basegrid.py:1.35 --- PanGalactic/pangalactic/utils/basegrid.py:1.34 Mon Jul 19 16:07:49 2004 +++ PanGalactic/pangalactic/utils/basegrid.py Wed Aug 11 13:44:30 2004 @@ -1,3 +1,14 @@ +# $Id: basegrid.py,v 1.35 2004/08/11 17:44:30 waterbug Exp $ + +""" +Wrapper for the grid that adds the drag and drop functionality to the base +grid class. Also adds the ability to set the labels for the grid columns +and to fill a row of data given the data in a list format + +@version: $Revision: 1.35 $ +""" +__version__ = "$Revision: 1.35 $"[11:-2] + import cPickle import os import ConfigParser @@ -55,12 +66,15 @@ on the type of grid. """ - BaseRightClickMenuOptions = [(OBJECT_VIEWER, "Object Viewer..."), - (ID_POPUP_CLEAR_SELECTION, "Clear Selection"), - (pdfoptions.ID_CREATEPDF_POPUP, "Generate PDF for this table...")] + BaseRightClickMenuOptions = [(OBJECT_VIEWER, + "Object Viewer..."), + (ID_POPUP_CLEAR_SELECTION, + "Clear Selection"), + (pdfoptions.ID_CREATEPDF_POPUP, + "Generate PDF for this table...")] RightClickMenuOptions = [] - def __init__(self, parent, id, classname = None, localdb = None, intable = None): + def __init__(self, parent, id, classname=None, localdb=None, intable=None): wxGrid.__init__(self, parent, id) # single row column labels + extra for larger font self.SetColLabelSize(30) Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.109 PanGalactic/pangalactic/client/fnord.py:1.110 --- PanGalactic/pangalactic/client/fnord.py:1.109 Wed Aug 11 10:20:36 2004 +++ PanGalactic/pangalactic/client/fnord.py Wed Aug 11 13:44:29 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.109 2004/08/11 14:20:36 waterbug Exp $ +# $Id: fnord.py,v 1.110 2004/08/11 17:44:29 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.109 $ +@version: $Revision: 1.110 $ """ -__version__ = "$Revision: 1.109 $"[11:-2] +__version__ = "$Revision: 1.110 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -39,7 +39,7 @@ from pangalactic.client.modules.psm import searchframe from pangalactic.client.modules.psm import psmtool -from pangalactic.client.pgefstate import PgefState +from pangalactic.utils import pgefstate workingdir = os.getcwd() Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.136 PanGalactic/pangalactic/utils/datamanager.py:1.137 --- PanGalactic/pangalactic/utils/datamanager.py:1.136 Wed Aug 11 10:20:36 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Wed Aug 11 13:44:30 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.136 $ +@version: $Revision: 1.137 $ """ -__version__ = "$Revision: 1.136 $"[11:-2] +__version__ = "$Revision: 1.137 $"[11:-2] import time import mx.DateTime @@ -291,15 +291,8 @@ self.saveUser(user2save) self.localDB.savePasswds(password, password) return True - -# except Exception, e: -# print "datamanager.login FAILURE" -# #import traceback -# #traceback.print_exc() -# return False - def setRoles(self, roles): """ Set the watchdog's roles and save them locally. Index: PanGalactic/pangalactic/utils/pgefdatatable.py diff -u PanGalactic/pangalactic/utils/pgefdatatable.py:1.16 PanGalactic/pangalactic/utils/pgefdatatable.py:1.17 --- PanGalactic/pangalactic/utils/pgefdatatable.py:1.16 Wed Aug 11 02:21:11 2004 +++ PanGalactic/pangalactic/utils/pgefdatatable.py Wed Aug 11 13:44:30 2004 @@ -12,9 +12,13 @@ def __init__(self): wxPyGridTableBase.__init__(self) - # identifiers ## list of data object attribute names, 1 per column, in order from left to right + # identifiers ## list of data object attribute names, 1 per + # ## column, in order from left to right + # _data ## list of data objects, 1 per row - # display_map ## list of tuples : (attribute name, column label), 1 per column + + # display_map ## list of tuples : (attribute name, column + # ## label), 1 per column self.identifiers = [] self._data = [] From waterbug at ned.gsfc.nasa.gov Thu Aug 12 10:17:26 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 12 10:17:29 2004 Subject: [Pangalactic-commits] Lots of little things ... Message-ID: <200408121417.i7CEHQNO004045@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.110 1.111 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.170 1.171 PanGalactic/pangalactic/utils/configdbbrowser.py 1.10 1.11 PanGalactic/pangalactic/utils/datamanager.py 1.137 1.138 PanGalactic/pangalactic/utils/loginclass.py 1.7 1.8 PanGalactic/pangalactic/utils/pgefstate.py 1.1 1.2 Log message: Lots of little things ... Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.137 PanGalactic/pangalactic/utils/datamanager.py:1.138 --- PanGalactic/pangalactic/utils/datamanager.py:1.137 Wed Aug 11 13:44:30 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Thu Aug 12 10:17:25 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.137 $ +@version: $Revision: 1.138 $ """ -__version__ = "$Revision: 1.137 $"[11:-2] +__version__ = "$Revision: 1.138 $"[11:-2] import time import mx.DateTime @@ -269,7 +269,7 @@ return False self.inLocalMode = False self.watchdog.inLocalMode = False - prefs['lastlogin'] = username + prefs['userid'] = username self.watchdog.user = Person(id=username) self.watchdog.user._password = password self.watchdog.user._loggedin = True Index: PanGalactic/pangalactic/utils/configdbbrowser.py diff -u PanGalactic/pangalactic/utils/configdbbrowser.py:1.10 PanGalactic/pangalactic/utils/configdbbrowser.py:1.11 --- PanGalactic/pangalactic/utils/configdbbrowser.py:1.10 Wed Jun 30 16:47:16 2004 +++ PanGalactic/pangalactic/utils/configdbbrowser.py Thu Aug 12 10:17:25 2004 @@ -14,12 +14,12 @@ class ConfigDbBrowser(ConfigureDisplay, wxColumnSorterMixin): def __init__(self, parent, id, - pos = wxPyDefaultPosition, - size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL, - dbroot = None, - collection_name = None, - current_config = None): + pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL, + dbroot=None, + collection_name=None, + current_config=None): ConfigureDisplay.__init__(self, parent, id, pos, size, style) print "configdbbrowser.init" self.collection_name = collection_name @@ -63,7 +63,10 @@ def CreateAttributeList(self): - """Creates the list of all available attribute names in the entire collection""" + """ + Create the list of all available attribute names in the entire + collection. + """ #print "configdbb.createattributelist", self.collection_name temp = {} collection = self.dbroot[self.collection_name] @@ -81,9 +84,11 @@ def ReloadSelections(self): - """Reloads the shown listctrl with the previous selections and also updates the grid""" + """ + Reload the shown listctrl with the previous selections and update + the grid. + """ #print "configdbb.reloadselections" - #Get the list of tuples that are attr name and display name if self.dbroot.has_key(DISPLAY_CONFIG): #print "have display_config" @@ -149,4 +154,4 @@ def OnOK(self, event): self.SaveConfig() self.Parent.Close() - + Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.110 PanGalactic/pangalactic/client/fnord.py:1.111 --- PanGalactic/pangalactic/client/fnord.py:1.110 Wed Aug 11 13:44:29 2004 +++ PanGalactic/pangalactic/client/fnord.py Thu Aug 12 10:17:24 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.110 2004/08/11 17:44:29 waterbug Exp $ +# $Id: fnord.py,v 1.111 2004/08/12 14:17:24 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.110 $ +@version: $Revision: 1.111 $ """ -__version__ = "$Revision: 1.110 $"[11:-2] +__version__ = "$Revision: 1.111 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -39,7 +39,7 @@ from pangalactic.client.modules.psm import searchframe from pangalactic.client.modules.psm import psmtool -from pangalactic.utils import pgefstate +from pangalactic.utils.pgefstate import PgefState workingdir = os.getcwd() @@ -65,11 +65,9 @@ ID_FILE_IMPORTPARTSLIST = wxNewId() ID_FILE_IMPORTDOCUMENT = wxNewId() - ID_FILE_EXIT = wxNewId() ID_FILE_NEW = wxNewId() ID_FILE_IMPORT = wxNewId() -ID_FILE_SAVE = wxNewId() ID_FILE_COMMIT = wxNewId() ID_FILE_PRINT = wxNewId() ID_FILE_CLOSETOOL = wxNewId() @@ -121,7 +119,7 @@ wxStatusBar.__init__(self, parent, -1) self.SetFieldsCount(3) self.statuspanel = wxPanel(self, -1) - + self.hsizer = wxBoxSizer(wxHORIZONTAL) self.bmp = ToolkitImages.getGreenDotBitmap() self.statusbitmap = wxStaticBitmap(self.statuspanel, -1, self.bmp) @@ -130,17 +128,17 @@ self.mytext = wxStaticText( self.statuspanel, -1, 'Local') self.mytext.SetBackgroundColour('Red') self.hsizer.Add(self.mytext, wxALIGN_TOP | wxEXPAND) - + self.statuspanel.SetAutoLayout(True) self.statuspanel.SetSizer(self.hsizer) - + self.sizeChanged = False EVT_SIZE(self, self.OnSize) EVT_IDLE(self, self.OnIdle) self.Reposition() self.sizeChanged = True - + def SetMsg(self, msgtext): self.SetStatusText(" " + msgtext, 1) @@ -149,13 +147,13 @@ def SetServer(self, servername): self.mytext.SetLabel(servername) - + def ClearServer(self): self.mytext.SetLabel(" ") - + def ShowImage(self, value): self.statusbitmap.Show(value) - + def OnSize(self, evt): self.Reposition() # for normal size events @@ -176,7 +174,7 @@ self.statuspanel.SetSize(rsize) self.sizeChanged = False - + class MainFrame(wxFrame): """This class encapsulates the main client window""" def __init__(self, parent, ID, title, pos, size): @@ -188,7 +186,7 @@ self.SearchFrame = None self.CacheFrame = None self.psmtool = None - self.State = PgefState(workingdir = workingdir) + self.State = PgefState(workingdir=workingdir) self.Closing = False self.ImportPartsListFrame = None wxInitAllImageHandlers() @@ -197,7 +195,7 @@ self.GodMenu = None self.GodMode = None self.SpecialPos = 5 - + if not os.path.exists('tmp'): os.makedirs('tmp') @@ -211,8 +209,9 @@ self.HelpTitle = "About " + self.AppTitle self.HelpText = "This is the Pan-Galactic Engineering Framework.\n\n" + \ "Help TBD RSN" - + EVT_SIZE(self, self.OnSize) + EVT_MENU(self, ID_FILE_COMMIT, self.Commit) EVT_MENU(self, ID_FILE_EXIT, self.OnClose) EVT_MENU(self, ID_FILE_CLOSETOOL, self.CloseTools) @@ -223,14 +222,14 @@ EVT_MENU(self, ID_FILE_NEWMODEL, self.OnNewModel) EVT_MENU(self, ID_FILE_NEWDOCUMENT, self.OnNewDocument) EVT_MENU(self, ID_FILE_NEWPARTSLIST, self.OnNewPartsList) + EVT_MENU(self, ID_TOOL_SEARCH, self.OnSearch) EVT_MENU(self, ID_TOOL_GETMYSTUFF, self.OnGetMyStuff) - EVT_MENU(self, ID_TOOL_DOC_NEW, self.OnNewDocument) EVT_MENU(self, ID_TOOL_PL_NEW, self.OnNewPartsList) EVT_TOOL(self, ID_TOOL_GRIDTOPDF, self.OnGridToPdf) EVT_MENU(self, ID_TOOL_DBBROWSER, self.OnDBBrowser) - + EVT_MENU(self, ID_HELP_ABOUT, self.onAbout) EVT_MENU(self, ID_HELP_CONTENTS, self.onContents) @@ -243,16 +242,16 @@ EVT_MENU(self, ID_PREF_USERID, self.OnSetUserId) EVT_MENU(self, ID_PREF_PASSWD, self.onPasswd) EVT_MENU(self, ID_PREF_TOOLTIPS, self.OnEnableTooltips) - EVT_MENU(self, ID_PREF_SHOWLOGINCONFIRMED, self.OnLoginConfirmed) + EVT_MENU(self, ID_PREF_SHOWLOGINCONFIRMED, self.OnShowLoginConfirmed) EVT_MENU(self, ID_PREF_OUTPUTDIR, self.OnSetOutputDir) - + EVT_MENU(self, ID_ADMIN_PASSWD, self.onAdminPasswd) EVT_MENU(self, ID_ADMIN_ADDUSER, self.onAdminAddUser) EVT_MENU(self, ID_ADMIN_SEARCHUSER, self.onAdminSearchUser) - + preferences.LoadPreferences(1) - showloginconfirm = prefs.get('ShowLoginConfirmation', True) + showloginconfirm = prefs.get('ShowLoginConfirmed', True) self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, int(showloginconfirm)) @@ -265,7 +264,7 @@ sizer.Add(label, 0, wxALIGN_LEFT|wxTOP|wxLEFT|wxRIGHT, 5) username = wxTextCtrl(dlg, -1, "", size=(180,-1)) sizer.Add(username, 1, wxALIGN_LEFT|wxBOTTOM|wxLEFT|wxRIGHT, 5) - + label = wxStaticText(dlg, -1, "Email:") sizer.Add(label, 0, wxALIGN_LEFT|wxTOP|wxLEFT|wxRIGHT, 5) email = wxTextCtrl(dlg, -1, "", size=(180,-1)) @@ -275,20 +274,20 @@ btn = wxButton(dlg, wxID_OK, " OK ") btn.SetDefault() box.Add(btn, 0, wxALIGN_LEFT|wxALL, 5) - + btn = wxButton(dlg, wxID_CANCEL, " Cancel ") box.Add(btn, 0, wxALIGN_LEFT|wxALL, 5) - + sizer.AddSizer(box, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5) dlg.SetSizer(sizer) dlg.SetAutoLayout(True) sizer.Fit(dlg) - + dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['userid'] = username.GetValue() prefs['email'] = email.GetValue() - + preferences.CreatePreferencesFile(prefs) dlg.Destroy() @@ -309,7 +308,7 @@ self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=self.State.currentprojectname) - self.activateTool() + self.ActivateTool() self.OnServerCombo() show_tooltips = prefs.get("ShowToolTips", False) if show_tooltips: @@ -320,20 +319,21 @@ self.menuBar.Check(ID_PREF_TOOLTIPS, False) except LocalStorageError: - noZODBdlg = wxMessageDialog(self, "PGEF is already running or the local cache is corrupt", - "PGEF Error", wxOK | wxICON_EXCLAMATION) + noZODBdlg = wxMessageDialog(self, + "PGEF is already running or the local cache is corrupt", + "PGEF Error", wxOK | wxICON_EXCLAMATION) noZODBdlg.CentreOnParent() noZODBdlg.ShowModal() noZODBdlg.Destroy() self.Close(True) - + def SetGaugeRange(self, value): self.sb.gauge.SetRange(value) - + def SetGaugeIndicator(self, value): self.sb.gauge.SetValue(value) - + def ConfigureStatusBar(self, width): flyover_len = int(width * 0.35) msg_len = int(width * 0.4) @@ -349,10 +349,10 @@ tb.AddControl(wxComboBox(tb, self.ToolbarServerID, "", choices=[self.dm.serverName, "Local"], size=(150,-1), style=wxCB_DROPDOWN|wxCB_READONLY)) tb.Realize() - + def CreateMenu(self): """ Encapsulates the code that creates the menu and adds the menu items. Note that - there is are dynamically added menus. Admin is added at position 3, Tool menus + there are dynamically added menus. Admin is added at position 3, Tool menus are added directly to the left of the Help menu.""" self.menuBar = wxMenuBar() @@ -413,7 +413,7 @@ submenu = wxMenu() submenu.Append(ID_PREF_TOOLTIPS, 'Show &Tooltips', 'Turn on/off flyover help', True) - submenu.Append(ID_PREF_SHOWLOGINCONFIRMED, 'Show Login &Confirmation', 'Show/hide login confirmation', True) + submenu.Append(ID_PREF_SHOWLOGINCONFIRMED, 'Show Login &Confirmed', 'Show/hide login confirmation', True) submenu.Append(ID_PREF_OUTPUTDIR, 'Set &Output Directory...', 'Where do my reports go?') submenu.Append(ID_PREF_PROXY, 'Pro&xy...', 'Set your proxy (if any)') submenu.Append(ID_PREF_SERVER2, '&Repository...', 'What repository do I use?') @@ -421,37 +421,39 @@ submenu.Append(ID_PREF_PASSWD, 'Change &Password...', 'Change your password') submenu.Enable(ID_PREF_PASSWD, False) self.menuBar.Append(submenu, "&Options") - + menu = wxMenu() menu.Append(ID_HELP_ABOUT, "&About", "Build Date and Version") menu.Append(ID_HELP_CONTENTS, "&Contents", "General information about this program") self.menuBar.Append(menu, "&Help") - + self.SetMenuBar(self.menuBar) - + def GetPSMTool(self): return self.psmtool - - + + def CheckAndLoadTool(self): self.InitializeTool() - + def OnExportProperties(self, event): self.psmtool.ExportProperties() - - def OnServerCombo(self, event = None): + + def OnServerCombo(self, event=None): + print "fnord.OnServerCombo, State =", self.State if self.dm.inLocalMode: + print "DM in local mode" self.psmtool.SetupForLocalMode() self.sb.ShowImage(False) - - else: self.menuBar.Enable(ID_FILE_LOGIN, True) + else: + print "DM in non-local mode" self.psmtool.SetupForLogin() self.sb.ShowImage(True) - + def OnSearch(self, event): self.psmtool.OnSearchItems() - + def OnNewPart(self, event): #print "psmtool.onnewpart" metadata = ["MENU", None, "Part"] @@ -461,19 +463,19 @@ #print "psmtool.onnewmodel" metadata = ["MENU", None, "Model"] self.psmtool.OnNewModel(metadata) - + def OnNewPartsList(self, event): self.psmtool.OnNewPartsList() - + def OnNewDocument(self, event): self.psmtool.OnNewDoc() - + def OnClearLocalDB(self, event): if self.dm.uncommittedData(): msg = "You have uncommitted changes. Really clear the local cache?" else: msg = "Really clear the local cache?" - + dlg = wxMessageDialog(self, msg, "Warning: Data Loss Imminent", wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION) dlg.CentreOnParent() @@ -517,17 +519,17 @@ prefs["ShowToolTips"] = False preferences.CreatePreferencesFile(prefs) event.Skip() - - def OnLoginConfirmed(self, event): + + def OnShowLoginConfirmed(self, event): id = event.GetId() checked = self.menuBar.FindItemById(id).IsChecked() if checked: - prefs['ShowLoginConfirmation'] = True + prefs['ShowLoginConfirmed'] = True else: - prefs['ShowLoginConfirmation'] = False + prefs['ShowLoginConfirmed'] = False preferences.CreatePreferencesFile(prefs) - + def OnSetUserId(self, event): user = prefs.get('userid', None) if user: @@ -547,7 +549,7 @@ print "hook up pythoncard window here. TBD RSN" self.chPasswd("admin") - + def showUser(self, mode): tmpsize = wxSize(650, 500) user_frame = toolframe.toolFrame(self, -1, "User Data", wxDefaultPosition, tmpsize) @@ -556,16 +558,16 @@ user_frame.mainpanel = userinfo.UserInfo(user_frame, -1, mode = mode, datamgr = self.dm) user_frame.CentreOnParent() user_frame.Show(True) - + def onAdminAddUser(self, event): self.showUser(mode = userinfo.ADD_MODE) - + def onAdminSearchUser(self, event): self.searchUser() - + # def onAdminEditUser(self, event): # self.searchUser(mode = userinfo.EDIT_MODE) - + # def onAdminDisableUser(self, event): # self.searchUser(mode = userinfo.DISABLE_MODE) @@ -653,14 +655,14 @@ ## print "hook up pythoncard window here. TBD RSN" ## self.onPasswd(event) - + ## def onPasswd(self, event): ## login_passwd = self.dm.getPasswd("login") ## curr_passwd = self.dm.getPasswd("current") ## #print "passwd", login_passwd, curr_passwd ## dlg = ChangePasswd(self, -1, "Change Password") ## dlg.CentreOnParent() - + ## still_trying = True ## while still_trying: ## if dlg.ShowModal() == wxID_OK: @@ -678,7 +680,7 @@ ## dlg.SetTitle("Try Again?") ## else: ## still_trying = False - + ## dlg.Destroy() @@ -691,14 +693,14 @@ ## user_frame.mainpanel = userinfo.UserInfo(user_frame, -1, mode = mode, datamgr = self.dm) ## user_frame.CentreOnParent() ## user_frame.Show(True) - - + + ## def onAdminAddUser(self, event): ## self.showUser(mode = userinfo.ADD_MODE) ## def onAdminEditUser(self, event): ## self.searchUser(mode = userinfo.EDIT_MODE) - + ## def onAdminDisableUser(self, event): ## self.searchUser(mode = userinfo.DISABLE_MODE) @@ -796,12 +798,12 @@ dbb_frame.mainpanel.FillChoice(config_access) dbb_frame.CentreOnParent() dbb_frame.Show(True) - - + + def OnGridToPdf(self, event = None): self.psmtool.OnGridToPdf() - + def OnGetMyStuff(self, event=None): if self.dm.user._loggedin: if not self.SearchFrame: @@ -821,8 +823,8 @@ if self.SearchFrame: self.SearchFrame.Show(False) self.SearchFrame = None - - + + def Commit(self, event): print "fnord.commit" objlist = self.dm.getUncommittedObjs() @@ -840,7 +842,7 @@ def CloseTools(self, event = None): self.psmtool.CloseTool(event) self.SetTitle(PGEF_TITLE) - + def onAbout(self, event): dlg = AboutBox(self, -1, self.HelpTitle, wxDefaultPosition, wxSize(300, 200)) dlg.GetVersion().SetLabel(self.Version) @@ -865,7 +867,7 @@ self.RemoveAdminMenu(user_info) elif self.GodMenu: #userinfo.god and self.GodMenu: self.RemoveGodMenu() - + def RemoveAdminMenu(self, user_info): self.menuBar.Remove(self.SpecialPos) # the admin menu self.menuBar.Refresh() @@ -875,7 +877,7 @@ adminmenu = wxMenu() adminmenu.Append(ID_ADMIN_SEARCHUSER, "&Find User...", "Search for a user") return adminmenu - + def AddAdminMenu(self, user_info): """ @@ -929,15 +931,15 @@ def OnLogin(self, event): - print "fnord.onlogin" - loginconfirm = prefs.get('ShowLoginConfirmation', None) + print "fnord.OnLogin" + loginconfirm = prefs.get('ShowLoginConfirmed', None) dialog = LoginClass(self, -1, "PGEF Login" ) if loginconfirm == None: loginconfirm = True - + dialog.GetCheckboxConfirmed().SetValue(int(loginconfirm)) dialog.GetCheckboxUseSSL().SetValue(int(self.secure)) - + dialog.GetRepository().Clear() serverlist = self.dm.getServerList() for entry in serverlist: @@ -961,8 +963,10 @@ still_trying = False elif result == wxID_OK: - prefs['ShowLoginConfirmation'] = dialog.GetCheckboxConfirmed().GetValue() - self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, dialog.GetCheckboxConfirmed().GetValue()) + prefs['ShowLoginConfirmed'] = dialog.GetCheckboxConfirmed( + ).GetValue() + self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, + dialog.GetCheckboxConfirmed().GetValue()) preferences.CreatePreferencesFile(prefs) self.secure = dialog.GetCheckboxUseSSL().GetValue() self.dm.serverName = dialog.GetRepository().GetStringSelection() @@ -971,10 +975,12 @@ if self.dm.login(self.dm.user.id, self.dm.user._password, secure=self.secure): - dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, - wxSize(400, 75), wxTHICK_FRAME) - msg = wxStaticText(dlg, -1, "Please wait while PGEF validates your login...", - wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) + dlg = wxDialog(self, -1, "A Message from PGEF", + wxDefaultPosition, wxSize(400, 75), + wxTHICK_FRAME) + msg = wxStaticText(dlg, -1, + "Please wait while PGEF validates your login...", + wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) @@ -999,12 +1005,13 @@ self.sb.ShowImage(True) self.psmtool.UpdateForLogin() self.addSpecialMenus(self.dm.user) + self.OnServerCombo() dlg.Destroy() dialog.Destroy() still_trying = False - if prefs.get('ShowLoginConfirmation', None): + if prefs.get('ShowLoginConfirmed', None): if self.State.currentprojectname: sdlg = wxMessageDialog(self, "Login successful.", "Yay!", wxOK) else: @@ -1012,7 +1019,6 @@ sdlg.CentreOnParent() sdlg.ShowModal() sdlg.Destroy() - else: dialog.SetTitle("Try Again?") @@ -1020,7 +1026,7 @@ def OnClose(self, event): """OnClose method that handles all the work that is required before we can successfully close down the application""" - + #since we call close from inside this method, we use the guard variable self.Closing #to skip the event if we are already working on closing down. if self.Closing: @@ -1057,11 +1063,11 @@ event.Skip() dlg.Destroy() - def activateTool(self): - print "fnord.activateTool", self.State + def ActivateTool(self): + print "fnord.ActivateTool, State =", self.State if self.psmtool and self.psmtool.IsShown(): return - + if self.psmtool: self.psmtool.Show(True) else: @@ -1069,12 +1075,12 @@ self.psmtool = psmtool.CreateTool(self, self.dm, self.State, -1, pos) self.ProcessEvent(wxSizeEvent(self.GetSize())) self.SetTitle (PGEF_TITLE) - + def OnActivateTool (self, event): self.sb.ClearMsg() - self.activateTool() - - + self.ActivateTool() + + def InitializeTool(self): #print "fnord.initializetool", self.State tbh = self.GetToolBar().GetSizeTuple()[1] @@ -1089,11 +1095,11 @@ self.psmtool = psmtool.CreateTool(self, self.dm, self.State, -1, pos, wxSize(1,1)) self.ProcessEvent(wxSizeEvent(self.GetSize())) - + #---------------------------------------------------------------------------- class MyApp(wxApp): - + def OnInit(self): self.frame = MainFrame(NULL, -1, PGEF_TITLE, wxDefaultPosition, wxSize(800, 600)) self.frame.CentreOnParent() Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.170 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.171 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.170 Tue Aug 10 15:07:18 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Thu Aug 12 10:17:24 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.170 $"[11:-2] +__version__ = "$Revision: 1.171 $"[11:-2] import os @@ -69,15 +69,14 @@ except ImportError: print "NOTE: Export of properties to MS Excel is not available." CAN_EXPORT_PROPERTIES = False - - + + ID_PARTSLIST_MENU = wxNewId() ID_PARTSLIST_LINKITEM = wxNewId() ID_ITEM_CREATE = wxNewId() ID_MAIN_WINDOW = wxNewId() ID_FILE_CLOSE = wxNewId() -ID_PSM_SAVE_LOCAL = wxNewId() ID_PSM_SEARCH_ITEMS = wxNewId() ID_EDITFRAME_ITEM = wxNewId() ID_EDITFRAME_PARTS = wxNewId() @@ -91,17 +90,18 @@ # this is the order of the notebook pages (grids) GRIDLIST = ["Part", "Model"] +prefs = preferences.prefs CurrentProjectName = "" def CreateTool(parent, datamgr, state, ID, pos): return PSMTool(parent, datamgr, state, ID, pos, wxSize(1,1)) - + class PSMTool(wxPanel, Security_Mixin): '''This class encapsulates the main client window''' ID_WINDOW_TOP = wxNewId() ID_WINDOW_LEFT = wxNewId() - + def __init__(self, parent, datamgr, state, ID, pos, size): wxPanel.__init__(self, parent, ID, pos, size) @@ -118,12 +118,12 @@ self.acroreaderids = [] self.ToolMenu = None self.ClosingDocTool = False - + self.SetSize (self.Parent.GetClientSize()) # will occupy the space not used by the Layout Algorithm self.grid_notebook = wxNotebook(self, -1, wxDefaultPosition, wxSize(200, 200)) - + #Create grid to hold Models # self.modelgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, # classname = "Model", @@ -141,7 +141,7 @@ self.grid_notebook.AddPage(self.modelgrid, "Models") self.modelgrid.Fit() # remove funny blank space in the first row of the grid, # if it initially has a scrollbar - + # Create Grid to hold Parts # self.itemgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, # classname = "Part", @@ -174,7 +174,7 @@ "You're on your own." win.SetToolTip(wxToolTip(grid_tooltip)) self.grid_notebook.AddPage(win, "PyCrust") - + # Create some layout windows # A window like a toolbar win = wxSashLayoutWindow(self, self.ID_WINDOW_TOP, @@ -195,16 +195,16 @@ win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetSashVisible(wxSASH_RIGHT, True) - + self.leftPanel = wxPanel(win, ID_LEFT_PANEL) hbox = wxBoxSizer(wxVERTICAL) - + choice_list = ["Default", "Requirements", "Functions", "Simulations"] self.view = wxChoice(self.leftPanel, ID_CHOICE_VIEW, wxPoint(90, 50), wxSize(95, -1), choice_list) hbox.Add(self.view, 0, wxEXPAND) - + self.tree_notebook = wxNotebook(self.leftPanel, -1, wxDefaultPosition, wxSize(200, 200)) - + self.tID = wxNewId() self.treeMap = {} self.tree = pgefmaintree.PgefMainTree(self.tree_notebook, self.tID, self.dm) @@ -214,7 +214,7 @@ "Doubleclick on a part to display the Part Editor." self.tree.SetToolTip(wxToolTip(tree_tooltip)) self.tree_notebook.AddPage(self.tree, 'Assembly') - + self.version_tree_ID = wxNewId() self.version_tree = pgefversiontree.PgefVersionTree(self.tree_notebook, self.version_tree_ID, @@ -225,11 +225,11 @@ self.version_tree.SetToolTip(wxToolTip(tree_tooltip)) self.tree_notebook.AddPage(self.version_tree, 'Version') - + hbox.Add(self.tree_notebook, 1, wxEXPAND) self.leftPanel.SetSizer(hbox) hbox.Fit(self.leftPanel) - + self.leftWindow = win wxLayoutAlgorithm().LayoutWindow(self, self.grid_notebook) @@ -256,18 +256,18 @@ #Event bindings EVT_SIZE(self, self.OnSize) EVT_SASH_DRAGGED(self, self.ID_WINDOW_LEFT, self.OnSashDrag) - + EVT_MENU(self.Parent, ID_FILE_CLOSE, self.Parent.CloseActiveTool) EVT_MENU(self.Parent, ID_PSM_SEARCH_ITEMS, self.OnSearchItems) EVT_MENU(self, ID_TREE_RIGHTPOPUP_EDIT, self.OnEditComponent) EVT_MENU(self, ID_TREE_RIGHTPOPUP_SHOWPROJECT, self.OnShowProjectFrame) EVT_MENU(self, ID_TREE_RIGHTPOPUP_DUMPTOPDF, self.tree.DumpToPdf) - + EVT_CHOICE(self, toolbarpanel.ID_PROJECT, self.OnSelectProject) EVT_CHOICE(self, toolbarpanel.ID_ITEM, self.OnItemClick) EVT_GRID_CELL_LEFT_DCLICK(self.itemgrid, self.onGridDClick) EVT_GRID_CELL_LEFT_DCLICK(self.modelgrid, self.onGridDClick) - + #EVT_GRID_CELL_LEFT_CLICK(self.itemgrid, self.onGridClickGetVersions) #EVT_GRID_CELL_LEFT_CLICK(self.modelgrid, self.onGridClick) @@ -285,10 +285,10 @@ EVT_LEFT_DCLICK(self.version_tree, self.OnEditComponent) EVT_CHOICE(self, ID_CHOICE_VIEW, self.SelectView) - + EVT_NOTEBOOK_PAGE_CHANGED(self, self.grid_notebook.GetId(), self.pageChanged) - + def synchGridSelections(self, obj): #print "psmtool.synchGridSelections" objclass = obj.__class__.__name__ @@ -307,7 +307,7 @@ row, tmp = self.itemgrid.getObjectByOid(obj.of_part) if row: self.itemgrid.SelectRow(row) - + def onGridClick(self, event): #print "psmtool.ongridclick" ndx = event.GetRow() @@ -329,8 +329,8 @@ def SelectView(self, event): print "psmtool.selectview" - - + + def pageChanged(self, event): #print "psmtool.pagechanged" gridpage = self.grid_notebook.GetSelection() @@ -345,7 +345,7 @@ # show the treepage that corresponds to the gridpage self.tree_notebook.SetSelection(gridpage) - + def GetCurrentGrid(self, currentpage = None): #print "psmtool.getcurrentgrid", currentpage currentgrid = None @@ -359,14 +359,14 @@ currentgrid = self.modelgrid return currentgrid return currentgrid - + def ExportProperties(self): #print "psmtool.exportproperties" if not CAN_EXPORT_PROPERTIES: print "Export to MS Excel is not available." return - + currentgrid = self.GetCurrentGrid() nrows = currentgrid.GetNumberRows() # sometimes the grid has one empty row if nrows == 0: @@ -375,7 +375,7 @@ dlg.ShowModal() dlg.Destroy() return - + #import partslistview temp = partslistview.PartsListView(self, -1, self.State) temp.Show(False) @@ -396,7 +396,7 @@ else: fdlg.Destroy() return - + files = [] for row in range(nrows): pid = currentgrid.GetObjectOid(row) @@ -408,7 +408,7 @@ self.dm.serverPort, "properties") if retval == 200: files.append([prod_id, os.path.join(self.State.workingdir, 'tmp', (pid + '.properties'))]) - + if len(files) > 0: try: #from modules.plm.ms2file import Data2MS @@ -431,7 +431,7 @@ edlg.ShowModal() edlg.Destroy() - + def OnRightDown(self, event): point = event.GetPosition() tree = event.GetEventObject() @@ -446,13 +446,13 @@ menu.Append(ID_TREE_RIGHTPOPUP_DUMPTOPDF, 'Generate PDF...', 'Show the PDF creation options') menu.SetHelpString(ID_TREE_RIGHTPOPUP_EDIT, "Edit this Part") menu.SetHelpString(ID_TREE_RIGHTPOPUP_SHOWPROJECT, "View Project Data") - + self.PopupMenuXY(menu, event.GetX(), event.GetY()) - + def SecureMenu(self): project = self.topWindow.toppanel.GetProjectWidget().GetStringSelection() self.AllowedActions = self.Parent.WatchDog.GetActions(project) - + if self.Allowed(actions.ADDALL): self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPART, True) self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWMODEL, True) @@ -464,30 +464,20 @@ else: self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPART, False) self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWMODEL, False) - + if self.Allowed(actions.ADDPARTSLIST): self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) else: self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, False) - + # if self.Allowed(actions.ADDDOCUMENT): ## vwk - need alert access flag # self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, True) # else: # self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, False) - - if self.Allowed(actions.MODIFYALL): - pass - else: - if self.Allowed(actions.MODIFYITEM): - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_SAVE, True) - self.Parent.menuBar.Enable(ID_TREE_RIGHTPOPUP_EDIT, True) - else: - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_SAVE, False) - self.Parent.menuBar.Enable(ID_TREE_RIGHTPOPUP_EDIT, False) - + if not self.Allowed(actions.DELETEITEM): pass - + def RebuildMainTree(self): #print "psmtool.rebuildmaintree" @@ -498,10 +488,10 @@ itemndx -= 1 itemobj = self.topWindow.toppanel.GetItemObject(itemndx) self.showItem(itemobj) - + def OnShowProjectFrame(self, event): self.ShowProjectFrame(self.State.currentprojectname) - + def ShowProjectFrame(self, project): if self.projectframe: if not self.projectframe.IsShown(): @@ -520,7 +510,7 @@ if self.projectframe: self.projectframe.Show(False) self.projectframe = None - + def ShowEditFrame(self, rootobj, nodedata = None, mode = itemeditframe.BROWSE_MODE): """ Create/Show the Edit Window. @@ -539,7 +529,7 @@ self.DisplayWgts, mode) self.itemeditform.Show(True) - + if self.dm.user._loggedin: self.itemeditform.sb.SetServer(self.dm.serverName) else: @@ -565,7 +555,7 @@ foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() foo.Show(True) - + def OnNewDoc(self): #print "psmtool.onnewdoc", self.State.currentprojectname @@ -574,7 +564,7 @@ foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() foo.Show(True) - + def OnGridToPdf(self, event = None): currentgrid = self.GetCurrentGrid() @@ -588,9 +578,9 @@ return currentgrid.DumpToPdf() - - - + + + def OnSearchItems(self, event = None): if not self.SearchFrame: self.SearchFrame = searchframe.SearchFrame(self, -1, 'Search', datamanager = self.dm) @@ -604,7 +594,7 @@ self.SearchFrame.Show(False) self.SearchFrame = None - + def Commit(self, closing = False, objectlist = None, dont_ask = False): """Save any changes made; retrieve the data from the local storage device and send it to the server.""" @@ -685,13 +675,13 @@ "Commit Results", wxOK | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() - + else: print "psmtool.commit: local mode; do nothing???" - + def UpdateForLogin(self): - #print "psmtool.updateforlogin" + print "psmtool.updateforlogin" if self.dm.user._loggedin: self.topWindow.toppanel.FillProjectWidget(self.dm.projects, "Select a Project") wgt = self.topWindow.toppanel.GetItemWidget() @@ -734,10 +724,10 @@ def GetNickName (self): return "PSM" - + def GetName (self): return "Product Structure Module" - + def GetTitle (self): """Return the titlebar text for the tool.""" return self.GetName() + " (" + self.GetNickName() + ")" @@ -750,12 +740,12 @@ self.ToolMenu = None mb.Refresh() - + def CloseDown(self): if self.dm.user._loggedin: self.CheckForUncommittedData(True) - + def CloseTool(self, event): if self.IsShown(): self.Show(False) @@ -765,9 +755,9 @@ self.itemeditform.OnCloseImportPartsListFrame() self.CloseProjectFrame() self.CloseDown() - + # WDR: handler implementations for MyFrame - + def OnSashDrag(self, event): if event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE: return @@ -781,14 +771,14 @@ wxLayoutAlgorithm().LayoutWindow(self, self.grid_notebook) self.grid_notebook.Refresh() - - + + def OnSize(self, event): self.SetSize(self.Parent.GetClientSize()) wxLayoutAlgorithm().LayoutWindow(self, self.grid_notebook) self.Layout() - - + + def OnTreeActivate(self, event): #print "psmtool.ontreeactivate" treeobj = self.tree.GetPyData(event.GetItem()) @@ -817,7 +807,7 @@ if self.dm.inLocalMode: print "Why check for uncommitted data in local mode???" return - + #bryan if self.dm.uncommittedData(): dlg = wxMessageDialog(self, "You have uncommitted changes. Shall I commit them?", @@ -825,7 +815,7 @@ wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_YES: self.Commit(closing) - + def showItem(self, itemobj): #print "psmtool.showitem", itemobj.id @@ -841,8 +831,8 @@ self.tree.expandRoot() self.version_tree.LoadTreefromObjects(self.dm, itemobj) - - + + def OnItemClick(self, event = None): #print "psmtool.onitemclick" ndx = self.topWindow.toppanel.GetItemWidget().GetSelection() @@ -858,7 +848,7 @@ itemobj = self.topWindow.toppanel.GetItemObject(ndx) if itemobj == None: return - + self.synchGridSelections(itemobj) try: @@ -904,11 +894,11 @@ if self.itemeditform: self.itemeditform.SecureMode() - preferences.AddPreference('lastproject', projectname) - + prefs['lastproject'] = projectname + wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) - + dlg = None if self.dm.user._loggedin: @@ -987,7 +977,7 @@ if self.SearchFrame: self.SearchFrame.searchform.ClearForm() self.SearchFrame.searchgrid.ClearGrid() - + def UpdateWgts(self, newitem): #print "psmtool.updatewgts" @@ -1002,7 +992,7 @@ foo = newitem.id wgt.AddData(foo, newitem) - + elif wgttype == "GRID": obj_type = self.DisplayWgts[ndx][2] class_type = newitem.__class__.__name__ @@ -1011,7 +1001,7 @@ self.SelectGridRowByItemId(newitem.pgef_oid) wgt.AutoSizeColumns(True) - + def FillGridFromProject(self, projectname): #print "psmtool.fillgridfromproject", projectname localproducts = self.dm.getLocalObjectsOfTypes(["Part", "Model"], projectname) @@ -1027,16 +1017,16 @@ plist.append([item.id, item]) elif classname == "Model": mlist.append([item.id, item]) - + plist.sort() mlist.sort() self.FillGridWithParts(self.itemgrid, plist, uncommitted_oids) self.FillGridWithModels(self.modelgrid, mlist, uncommitted_oids) - + return len(products) - + def FillItemWidgetFromProject(self, projectname): #print "psmtool.fillitemwgt" localitems = self.dm.getLocalObjectsOfTypes(["Model"], projectname) @@ -1082,7 +1072,7 @@ grid.AutoSizeColumns(True) grid.EndBatch() - + def FillLocalModeProjectWidget(self): #print "psmtool.filllocalmodeprojectwidget" @@ -1104,10 +1094,10 @@ ## tmp_role.id = "test" ## tmp_role.project = 'H2G2' ## tmp_roles.append(tmp_role) - + ## self.dm.saveRoles(tmp_roles) ## roles = self.dm.getRoles() - + wgt = self.topWindow.toppanel.GetProjectWidget() wgt.Clear() wgt.Append('Select a project') @@ -1119,15 +1109,15 @@ wgt.Enable(True) wgt.SetSelection(0) - - + + def inLocalMode(self): return self.dm.inLocalMode - + def ClearTreeAndGrid(self): self.tree.DeleteAllItems() - + def SetupForLocalMode(self, event = None): #print "setupforlocalmode" self.FillLocalModeProjectWidget() @@ -1144,17 +1134,18 @@ if ndx <> wxNOT_FOUND: wgt.SetSelection(wgt.FindString(self.State.currentprojectname)) wgt.SetStringSelection(self.State.currentprojectname) - + ndx = wgt.GetSelection() projectname = wgt.GetStringSelection() if ndx > 0: self.changeProject(ndx, projectname) - + + def SetupForLogin(self): #print "setupforlogin" wgt = self.Parent.menuBar.FindMenuItem('Repository', 'Get Marked Items') self.Parent.menuBar.Enable(wgt, True) - + def BuildTree(self, itemid): #print "psmtool.buildtree" @@ -1177,7 +1168,7 @@ else: print "psmtool.oneditcomponent::Unable to edit" return - + if node.IsOk(): nodedata = self.tree.GetPyData(node) wxBeginBusyCursor() @@ -1213,8 +1204,8 @@ grid.SelectRow(row) obj = grid.getObject(row) self.editGridObject(obj) - - + + def editGridObject(self, obj): print "psmtool.editgridobject", obj.id, obj.__class__.__name__ classname = obj.__class__.__name__ @@ -1241,20 +1232,20 @@ metadata = ["GRID", obj.id, classname] self.ShowEditFrame(rootobj = obj, nodedata = metadata, mode = itemeditframe.BROWSE_MODE) - + #____________________________________________________________________________________ if __name__ == '__main__': class MyApp(wxApp): - + def OnInit(self): frame = wxFrame(NULL, -1, "PSM Toolkit", wxDefaultPosition, wxSize(800, 600)) main = PSMTool(frame, -1, wxDefaultPosition, wxSize(800, 600)) frame.Show(True) self.SetTopWindow(frame) return True - + #---------------------------------------------------------------------------- app = MyApp(0) app.MainLoop() Index: PanGalactic/pangalactic/utils/loginclass.py diff -u PanGalactic/pangalactic/utils/loginclass.py:1.7 PanGalactic/pangalactic/utils/loginclass.py:1.8 --- PanGalactic/pangalactic/utils/loginclass.py:1.7 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/loginclass.py Thu Aug 12 10:17:25 2004 @@ -3,8 +3,11 @@ from pangalactic.utils.loginform_wdr import * class LoginClass(wxDialog): - """This class is a wrapper around the wxDesigner created LoginFunc. This is used so that - we have a class instance through which we can access the controls on the dialog. """ + """ + This class is a wrapper around the wxDesigner created LoginFunc. This + is used so that we have a class instance through which we can access + the controls on the dialog. + """ def __init__(self, parent, id, title, pos = wxPyDefaultPosition, size = wxPyDefaultSize, Index: PanGalactic/pangalactic/utils/pgefstate.py diff -u PanGalactic/pangalactic/utils/pgefstate.py:1.1 PanGalactic/pangalactic/utils/pgefstate.py:1.2 --- PanGalactic/pangalactic/utils/pgefstate.py:1.1 Wed Aug 11 13:44:30 2004 +++ PanGalactic/pangalactic/utils/pgefstate.py Thu Aug 12 10:17:25 2004 @@ -1,11 +1,11 @@ -# $Id: pgefstate.py,v 1.1 2004/08/11 17:44:30 waterbug Exp $ +# $Id: pgefstate.py,v 1.2 2004/08/12 14:17:25 waterbug Exp $ """ Global state for PGEF components. -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] from pangalactic.utils.toolstate import ToolState @@ -16,12 +16,12 @@ """ _shared_state = {} - def __init__(self, workingdir = ""): - self.__dict__ = _shared_state + def __init__(self, **kw): + self.__dict__ = self._shared_state ToolState.__init__(self) - self.workingdir = workingdir - self.currentprojectname = "" - self.currentuser = "" - self.currentuser = "" + for a in kw: + setattr(self, a, kw[a]) + def __str__(self): + return str(self.__dict__) From waterbug at ned.gsfc.nasa.gov Thu Aug 12 13:30:08 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 12 13:30:10 2004 Subject: [Pangalactic-commits] Simplifications: prefs, readPrefs(), writePrefs(). Message-ID: <200408121730.i7CHU8Tv006656@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.111 1.112 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.21 1.22 PanGalactic/pangalactic/client/modules/psm/docform.py 1.5 1.6 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.37 1.38 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.144 1.145 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.10 1.11 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.25 1.26 PanGalactic/pangalactic/client/modules/psm/partform.py 1.10 1.11 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.34 1.35 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.35 1.36 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.171 1.172 PanGalactic/pangalactic/utils/datamanager.py 1.138 1.139 PanGalactic/pangalactic/utils/pgefstate.py 1.2 1.3 PanGalactic/pangalactic/utils/preferences.py 1.4 1.5 Log message: Simplifications: prefs, readPrefs(), writePrefs(). Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.144 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.145 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.144 Tue Aug 10 12:13:38 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Thu Aug 12 13:30:05 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.144 $"[11:-2] +__version__ = "$Revision: 1.145 $"[11:-2] import copy import types @@ -32,7 +32,7 @@ from pangalactic.client.modules.psm import pgefversiontree from pangalactic.utils import objectstatus -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.utils import toolframe from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils.securitymanager import actions as security_actions @@ -1240,17 +1240,17 @@ def DiscardChanges(self): if self.dm.creatingPartsList: - plid = preferences.prefs.get('nextplid', 1) + plid = prefs.get('nextplid', 1) plid = int(plid) - 1 - preferences.prefs['nextplid'] = plid - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextplid'] = plid + writePrefs() self.partslistform.NextDocId = str(int(self.partslistform.NextDocId) - 1) if self.dm.creatingDocument: - docid = preferences.prefs.get('nextdocid', 1) + docid = prefs.get('nextdocid', 1) docid = int(docid) - 1 - preferences.prefs['nextdocid'] = docid - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextdocid'] = docid + writePrefs() self.documentform.NextDocId = str(int(self.documentform.NextDocId) - 1) if self.dm.creatingPart: Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.35 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.36 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.35 Tue Aug 10 12:13:38 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Thu Aug 12 13:30:05 2004 @@ -8,7 +8,7 @@ from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils import objectstatus -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs import pangalactic.utils.toolframe as toolframe from pangalactic.client.modules.psm import partslistview @@ -25,7 +25,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.35 $"[11:-2] +__version__ = "$Revision: 1.36 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -329,10 +329,10 @@ def DiscardChanges(self): if self.creatingDocument: - docid = preferences.prefs.get('nextplid', '1') + docid = prefs.get('nextplid', '1') docid = int(docid) - 1 - preferences.prefs['nextplid'] = docid - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextplid'] = docid + writePrefs() self.docform.NextDocId = str(int(self.docform.NextDocId) - 1) self.creatingDocument = False Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.10 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.11 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.10 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Thu Aug 12 13:30:05 2004 @@ -3,7 +3,7 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.client.modules.psm.modelform_wdr import * @@ -78,10 +78,10 @@ def getNextId(self): #print "modelform.getnextid" - temp = preferences.prefs.get("nextid", "0") + temp = prefs.get("nextid", "0") if temp: self.NextId = str(int(temp) + 1) - preferences.prefs["nextid"] = self.NextId + prefs["nextid"] = self.NextId #print "nextid", self.NextId @@ -217,11 +217,11 @@ def revertNextId(self): #print "modelform.revertnextid" - nextid = preferences.prefs.get("nextid", "0") + nextid = prefs.get("nextid", "0") if nextid: nextid = int(nextid) - 1 - preferences.prefs["nextid"] = nextid - preferences.CreatePreferencesFile(preferences.prefs) + prefs["nextid"] = nextid + writePrefs() #print "nextid", nextid self.NextId = None Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.171 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.172 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.171 Thu Aug 12 10:17:24 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Thu Aug 12 13:30:05 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.171 $"[11:-2] +__version__ = "$Revision: 1.172 $"[11:-2] import os @@ -39,7 +39,7 @@ #from pangalactic.utils import dbbrowser from pangalactic.utils import objectstatus from pangalactic.utils import toolframe -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.utils import pgdialogs from pangalactic.utils import ToolkitImages from pangalactic.utils.mixin_security import Security_Mixin @@ -90,7 +90,7 @@ # this is the order of the notebook pages (grids) GRIDLIST = ["Part", "Model"] -prefs = preferences.prefs +prefs = prefs CurrentProjectName = "" def CreateTool(parent, datamgr, state, ID, pos): Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.111 PanGalactic/pangalactic/client/fnord.py:1.112 --- PanGalactic/pangalactic/client/fnord.py:1.111 Thu Aug 12 10:17:24 2004 +++ PanGalactic/pangalactic/client/fnord.py Thu Aug 12 13:30:04 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.111 2004/08/12 14:17:24 waterbug Exp $ +# $Id: fnord.py,v 1.112 2004/08/12 17:30:04 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.111 $ +@version: $Revision: 1.112 $ """ -__version__ = "$Revision: 1.111 $"[11:-2] +__version__ = "$Revision: 1.112 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -18,7 +18,6 @@ from pangalactic.enterprise.person import Person from pangalactic.utils import oid from pangalactic.utils import dbbrowser -from pangalactic.utils import preferences from pangalactic.utils import toolstate from pangalactic.utils import toolframe from pangalactic.utils import ToolkitImages @@ -29,6 +28,7 @@ from pangalactic.utils.serverclass import * from pangalactic.utils.aboutbox import AboutBox from pangalactic.utils.changepasswd import ChangePasswd +from pangalactic.utils.preferences import prefs, readPrefs, writePrefs from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.usersearchframe import UserSearchFrame @@ -111,7 +111,6 @@ PRODUCT_TYPES = {ID_FILE_NEWPART : "Part", ID_FILE_NEWMODEL : "Model"} -prefs = preferences.prefs class CustomStatusBar(wxStatusBar): """ This method created the statusbar that is used on the main form """ @@ -249,7 +248,7 @@ EVT_MENU(self, ID_ADMIN_ADDUSER, self.onAdminAddUser) EVT_MENU(self, ID_ADMIN_SEARCHUSER, self.onAdminSearchUser) - preferences.LoadPreferences(1) + readPrefs(1) showloginconfirm = prefs.get('ShowLoginConfirmed', True) self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, @@ -288,7 +287,7 @@ prefs['userid'] = username.GetValue() prefs['email'] = email.GetValue() - preferences.CreatePreferencesFile(prefs) + writePrefs() dlg.Destroy() useroid = prefs.get('email', @@ -517,7 +516,7 @@ else: wxToolTip_Enable(False) prefs["ShowToolTips"] = False - preferences.CreatePreferencesFile(prefs) + writePrefs() event.Skip() def OnShowLoginConfirmed(self, event): @@ -527,7 +526,7 @@ prefs['ShowLoginConfirmed'] = True else: prefs['ShowLoginConfirmed'] = False - preferences.CreatePreferencesFile(prefs) + writePrefs() def OnSetUserId(self, event): @@ -539,7 +538,7 @@ dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['userid'] = dlg.GetValue() - preferences.CreatePreferencesFile(prefs) + writePrefs() dlg.Destroy() @@ -723,7 +722,7 @@ dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['outputdir'] = dlg.GetValue() - preferences.CreatePreferencesFile(prefs) + writePrefs() dlg.Destroy() def OnProxySettings(self, event): @@ -748,7 +747,7 @@ errdlg.ShowModal() else: prefs['proxy'] = server + ':' + port - preferences.CreatePreferencesFile(prefs) + writePrefs() def OnServerSettings(self, event): dlg = ServerDialog(self, -1, 'Enter Server Information') @@ -775,7 +774,7 @@ errdlg.ShowModal() else: prefs['server'] = server + ':' + port - preferences.CreatePreferencesFile(prefs) + writePrefs() self.dm.serverName = server self.dm.serverPort = port @@ -967,7 +966,7 @@ ).GetValue() self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, dialog.GetCheckboxConfirmed().GetValue()) - preferences.CreatePreferencesFile(prefs) + writePrefs() self.secure = dialog.GetCheckboxUseSSL().GetValue() self.dm.serverName = dialog.GetRepository().GetStringSelection() self.dm.user.id = dialog.GetTextctrlUsername().GetValue() @@ -1032,7 +1031,7 @@ if self.Closing: event.Skip() else: - preferences.CreatePreferencesFile(prefs) + writePrefs() if not self.WorkInProgress: #clean up the [tsv, properties, xls] files in the tmp directory tmpfiles = os.listdir(os.path.join(workingdir, "tmp")) Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.21 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.22 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.21 Mon Aug 9 17:55:32 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Thu Aug 12 13:30:05 2004 @@ -21,7 +21,7 @@ print "NOTE: Conversion for import of MS Excel Parts Lists is not available." from pangalactic.utils import toolframe -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.client.modules.plm.ms2file_new_wdr import * from pangalactic.client.modules.plm.epimsgrid import * @@ -919,7 +919,7 @@ if self.dm.user.id: userid = self.dm.user.id else: - userid = preferences.prefs.get('userid', None) + userid = prefs.get('userid', None) mapfilename = os.path.join(self.State.workingdir, "data", userid) + ".map" mapfile = open (mapfilename, "w", 1) for colndx, info in self.ColumnInfo.items(): @@ -933,7 +933,7 @@ if self.dm.user.id: userid = self.dm.user.id else: - userid = preferences.prefs.get('userid', None) + userid = prefs.get('userid', None) mapfilename = os.path.join(self.State.workingdir, "data", userid) + ".map" dlg = None Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.5 PanGalactic/pangalactic/client/modules/psm/docform.py:1.6 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.5 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Thu Aug 12 13:30:05 2004 @@ -4,7 +4,7 @@ from pangalactic.client.modules.psm.docform_wdr import * -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions @@ -16,8 +16,8 @@ self.parent = parent self.State = state - self.NextDocId = preferences.prefs.get("nextdocid", 0) - preferences.prefs["nextdocid"] = self.NextDocId + self.NextDocId = prefs.get("nextdocid", 0) + prefs["nextdocid"] = self.NextDocId DocFunc(self, True) @@ -223,8 +223,8 @@ wgt.SetValue("DOC-" + self.NextDocId) else: wgt.SetValue(self.State.currentprojectname + "-DOC-" + self.NextDocId) - preferences.prefs["nextdocid"] = self.NextDocId - preferences.CreatePreferencesFile(preferences.prefs) + prefs["nextdocid"] = self.NextDocId + writePrefs() self.EditingMode() Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.37 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.38 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.37 Tue Aug 10 12:13:38 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Thu Aug 12 13:30:05 2004 @@ -15,9 +15,9 @@ from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils import objectstatus -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs -__version__ = "$Revision: 1.37 $"[11:-2] +__version__ = "$Revision: 1.38 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -217,10 +217,10 @@ def DiscardChanges(self): if self.creatingDocument: - docid = preferences.prefs.get('nextdocid', 0) + docid = prefs.get('nextdocid', 0) docid = int(docid) - 1 - preferences.prefs['nextdocid'] = docid - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextdocid'] = docid + writePrefs() self.docform.NextDocId = str(int(self.docform.NextDocId) - 1) self.creatingDocument = False Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.34 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.35 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.34 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Thu Aug 12 13:30:05 2004 @@ -6,7 +6,7 @@ #import pangalactic.enterprise.partslist as partslist #import dataobjects.item -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions @@ -27,8 +27,8 @@ self.ColumnInfo = None self.ColumnMapping = None - self.NextDocId = preferences.prefs.get('nextplid', 0) - preferences.prefs['nextplid'] = self.NextDocId + self.NextDocId = prefs.get('nextplid', 0) + prefs['nextplid'] = self.NextDocId PartsListFunc(self, True) @@ -179,8 +179,8 @@ else: wgt.SetValue(self.State.currentprojectname + "-PL-" + self.NextDocId) wgt.SetFocus() - preferences.prefs['nextplid'] = self.NextDocId - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextplid'] = self.NextDocId + writePrefs() self.current_pl = None button = self.GetImportPartsListButton() Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.10 PanGalactic/pangalactic/client/modules/psm/partform.py:1.11 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.10 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Thu Aug 12 13:30:05 2004 @@ -4,7 +4,7 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.client.modules.psm.partform_wdr import * @@ -63,9 +63,9 @@ def getNextId(self): #print "partform.getnextid" - temp = preferences.prefs.get('nextid', '-1') + temp = prefs.get('nextid', '-1') self.NextId = str(int(temp) + 1) - preferences.prefs['nextid'] = self.NextId + prefs['nextid'] = self.NextId def Enable(self, state): @@ -196,10 +196,10 @@ def revertNextId(self): #print "partform.revertnextid" - nextid = preferences.prefs.get('nextid', '1') + nextid = prefs.get('nextid', '1') nextid = int(nextid) - 1 - preferences.prefs['nextid'] = nextid - preferences.CreatePreferencesFile(preferences.prefs) + prefs['nextid'] = nextid + writePrefs() self.NextId = None #print "nextid", nextid Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.25 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.26 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.25 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Thu Aug 12 13:30:05 2004 @@ -2,7 +2,7 @@ from wxPython.wx import * from otherdoc_wdr import * -from pangalactic.utils import preferences +from pangalactic.utils.preferences import prefs from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions #import pangalactic.enterprise.document as document @@ -14,8 +14,8 @@ self.parent = parent self.State = state - self.NextDocId = preferences.prefs.get("nextdocid", 0) - preferences.prefs["nextdocid"] = self.NextDocId + self.NextDocId = prefs.get("nextdocid", 0) + prefs["nextdocid"] = self.NextDocId OtherDocFunc(self, True) @@ -221,8 +221,8 @@ wgt.SetValue("DOC-" + self.NextDocId) else: wgt.SetValue(self.State.currentprojectname + "-DOC-" + self.NextDocId) - preferences.prefs["nextdocid"] = self.NextDocId - preferences.CreatePreferencesFile(preferences.prefs) + prefs["nextdocid"] = self.NextDocId + writePrefs() self.EditingMode() Index: PanGalactic/pangalactic/utils/preferences.py diff -u PanGalactic/pangalactic/utils/preferences.py:1.4 PanGalactic/pangalactic/utils/preferences.py:1.5 --- PanGalactic/pangalactic/utils/preferences.py:1.4 Mon Aug 9 17:55:33 2004 +++ PanGalactic/pangalactic/utils/preferences.py Thu Aug 12 13:30:06 2004 @@ -1,30 +1,38 @@ -import fileinput +# $Id: preferences.py,v 1.5 2004/08/12 17:30:06 waterbug Exp $ -PrefsFilename = 'pgef.cfg' +""" +Global preferences for PGEF user + +@version: $Revision: 1.5 $ +""" +__version__ = "$Revision: 1.5 $"[11:-2] + + +PrefsFilename = 'prefs.cfg' fileread = 0 prefs = {} -def LoadPreferences(refresh): +def readPrefs(refresh=0): + """ + Read preferences from the preferences file. + + @param refresh: if true, forces a read even if file has been read + """ global fileread - if not fileread or refresh: try: - for line in fileinput.input(PrefsFilename): + for line in file(PrefsFilename): key, value = line.split(' ~ ') prefs[key] = value.strip() except: - cfgfile = open(PrefsFilename,'w') - cfgfile.close() - + prefsfile = open(PrefsFilename,'w') + prefsfile.close() + fileread = 1 -def CreatePreferencesFile(prefsdict): +def writePrefs(): fo = open(PrefsFilename, 'w') - for key, value in prefsdict.items(): - fo.write(key + ' ~ ' + str(value) + '\n') + for p in prefs: + fo.write(p + ' ~ ' + prefs[p] + '\n') fo.close() - -def AddPreference(prefname, prefvalue): - if prefname and prefvalue: - prefs[prefname] = prefvalue Index: PanGalactic/pangalactic/utils/pgefstate.py diff -u PanGalactic/pangalactic/utils/pgefstate.py:1.2 PanGalactic/pangalactic/utils/pgefstate.py:1.3 --- PanGalactic/pangalactic/utils/pgefstate.py:1.2 Thu Aug 12 10:17:25 2004 +++ PanGalactic/pangalactic/utils/pgefstate.py Thu Aug 12 13:30:06 2004 @@ -1,15 +1,13 @@ -# $Id: pgefstate.py,v 1.2 2004/08/12 14:17:25 waterbug Exp $ +# $Id: pgefstate.py,v 1.3 2004/08/12 17:30:06 waterbug Exp $ """ Global state for PGEF components. -@version: $Revision: 1.2 $ +@version: $Revision: 1.3 $ """ -__version__ = "$Revision: 1.2 $"[11:-2] +__version__ = "$Revision: 1.3 $"[11:-2] -from pangalactic.utils.toolstate import ToolState - -class PgefState(ToolState): +class PgefState: """ A shared state singleton class, implemented using Alex Martelli's "Borg" idiom, from the Python Cookbook. (Thanks, Alex!) @@ -18,7 +16,6 @@ def __init__(self, **kw): self.__dict__ = self._shared_state - ToolState.__init__(self) for a in kw: setattr(self, a, kw[a]) Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.138 PanGalactic/pangalactic/utils/datamanager.py:1.139 --- PanGalactic/pangalactic/utils/datamanager.py:1.138 Thu Aug 12 10:17:25 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Thu Aug 12 13:30:06 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.138 $ +@version: $Revision: 1.139 $ """ -__version__ = "$Revision: 1.138 $"[11:-2] +__version__ = "$Revision: 1.139 $"[11:-2] import time import mx.DateTime @@ -29,15 +29,13 @@ from pangalactic.enterprise.pgeffile import PgefFile from pangalactic.enterprise.workflow import wffactory from pangalactic.meta.registry import PanGalacticRegistry -from pangalactic.utils import preferences from pangalactic.utils import localdb from pangalactic.utils import objectstatus from pangalactic.utils.httpupload import upload from pangalactic.utils.pgefexceptions import LocalStorageError +from pangalactic.utils.preferences import prefs, readPrefs, writePrefs from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.xmlrpcinterface import XmlrpcInterface - -prefs = preferences.prefs class DataManager: From waterbug at ned.gsfc.nasa.gov Thu Aug 12 15:46:18 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 12 15:46:22 2004 Subject: [Pangalactic-commits] Refurbishing states and prefs. Message-ID: <200408121946.i7CJkIoq008992@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.112 1.113 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.145 1.146 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.35 1.36 PanGalactic/pangalactic/client/modules/psm/partslistview.py 1.17 1.18 PanGalactic/pangalactic/client/modules/psm/projectframe.py 1.9 1.10 PanGalactic/pangalactic/client/modules/psm/propertiesform.py 1.16 1.17 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.172 1.173 PanGalactic/pangalactic/utils/datamanager.py 1.139 1.140 PanGalactic/pangalactic/utils/localdb.py 1.105 1.106 PanGalactic/pangalactic/utils/pgefstate.py 1.3 1.4 PanGalactic/pangalactic/utils/preferences.py 1.5 1.6 PanGalactic/pangalactic/utils/xmlrpcinterface.py 1.68 1.69 Log message: Refurbishing states and prefs. Index: PanGalactic/pangalactic/utils/preferences.py diff -u PanGalactic/pangalactic/utils/preferences.py:1.5 PanGalactic/pangalactic/utils/preferences.py:1.6 --- PanGalactic/pangalactic/utils/preferences.py:1.5 Thu Aug 12 13:30:06 2004 +++ PanGalactic/pangalactic/utils/preferences.py Thu Aug 12 15:46:16 2004 @@ -1,11 +1,11 @@ -# $Id: preferences.py,v 1.5 2004/08/12 17:30:06 waterbug Exp $ +# $Id: preferences.py,v 1.6 2004/08/12 19:46:16 waterbug Exp $ """ Global preferences for PGEF user -@version: $Revision: 1.5 $ +@version: $Revision: 1.6 $ """ -__version__ = "$Revision: 1.5 $"[11:-2] +__version__ = "$Revision: 1.6 $"[11:-2] PrefsFilename = 'prefs.cfg' @@ -33,6 +33,6 @@ def writePrefs(): fo = open(PrefsFilename, 'w') for p in prefs: - fo.write(p + ' ~ ' + prefs[p] + '\n') + fo.write(p + ' ~ ' + str(prefs[p]) + '\n') fo.close() Index: PanGalactic/pangalactic/utils/xmlrpcinterface.py diff -u PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.68 PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.69 --- PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.68 Mon Aug 9 14:37:09 2004 +++ PanGalactic/pangalactic/utils/xmlrpcinterface.py Thu Aug 12 15:46:16 2004 @@ -3,10 +3,10 @@ """ PanGalactic Client XML-RPC Interfaces -@version: $Revision: 1.68 $ +@version: $Revision: 1.69 $ """ -__version__ = "$Revision: 1.68 $"[11:-2] +__version__ = "$Revision: 1.69 $"[11:-2] import xmlrpclib import types @@ -127,7 +127,7 @@ else: conns = 'http://' conns = conns + host + ':' + str(port) - #print 'connection string is:', conns + print 'XmlrpcInterface: connection string is', conns if username and password: self.username = username if secure: Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.35 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.36 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.35 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Thu Aug 12 15:46:16 2004 @@ -1,6 +1,7 @@ from wxPython.wx import wxPanel, wxTAB_TRAVERSAL, wxPyTypeCast, wxPyDefaultPosition, wxPyDefaultSize from wxPython.wx import wxFileDialog from partslistform_wdr import * +from pangalactic.utils.pgefstate import state #import pangalactic.enterprise.partslist as partslist @@ -19,7 +20,6 @@ style = wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) - self.State = state self.debug = debug self.current_pl = None self.versionmode = 0 # create new @@ -166,7 +166,7 @@ self.Enable(True) wgt = self.GetTextctrlPoc() - wgt.SetValue(self.State.currentuser) + wgt.SetValue(state['currentuser']) wgt.Enable(False) wgt.SetEditable(False) wgt = self.GetTextctrlListversion() @@ -174,10 +174,10 @@ wgt = self.GetTextctrlPartslistid() #bryan self.NextDocId = str(int(self.NextDocId) + 1) - if self.State.currentprojectname == None: + if state['currentprojectname'] == None: wgt.SetValue("PL-" + self.NextDocId) else: - wgt.SetValue(self.State.currentprojectname + "-PL-" + self.NextDocId) + wgt.SetValue(state['currentprojectname'] + "-PL-" + self.NextDocId) wgt.SetFocus() prefs['nextplid'] = self.NextDocId writePrefs() Index: PanGalactic/pangalactic/utils/pgefstate.py diff -u PanGalactic/pangalactic/utils/pgefstate.py:1.3 PanGalactic/pangalactic/utils/pgefstate.py:1.4 --- PanGalactic/pangalactic/utils/pgefstate.py:1.3 Thu Aug 12 13:30:06 2004 +++ PanGalactic/pangalactic/utils/pgefstate.py Thu Aug 12 15:46:16 2004 @@ -1,24 +1,38 @@ -# $Id: pgefstate.py,v 1.3 2004/08/12 17:30:06 waterbug Exp $ +# $Id: pgefstate.py,v 1.4 2004/08/12 19:46:16 waterbug Exp $ """ -Global state for PGEF components. +Global state for a PGEF application -@version: $Revision: 1.3 $ +@version: $Revision: 1.4 $ """ -__version__ = "$Revision: 1.3 $"[11:-2] +__version__ = "$Revision: 1.4 $"[11:-2] -class PgefState: + +StateFilename = 'state.cfg' +fileread = 0 +state = {} + +def readState(refresh=0): """ - A shared state singleton class, implemented using Alex Martelli's - "Borg" idiom, from the Python Cookbook. (Thanks, Alex!) + Read state from the state file. + + @param refresh: if true, forces a read even if file has been read """ - _shared_state = {} + global fileread + if not fileread or refresh: + try: + for line in file(StateFilename): + key, value = line.split(' ~ ') + state[key] = value.strip() + except: + statefile = open(StateFilename,'w') + statefile.close() - def __init__(self, **kw): - self.__dict__ = self._shared_state - for a in kw: - setattr(self, a, kw[a]) + fileread = 1 - def __str__(self): - return str(self.__dict__) +def writeState(): + fo = open(StateFilename, 'w') + for p in state: + fo.write(p + ' ~ ' + str(state[p]) + '\n') + fo.close() Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.145 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.146 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.145 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Thu Aug 12 15:46:15 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.145 $"[11:-2] +__version__ = "$Revision: 1.146 $"[11:-2] import copy import types @@ -33,6 +33,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.utils import toolframe from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils.securitymanager import actions as security_actions @@ -51,12 +52,11 @@ Encapsulates the logic for graphically editing a product """ - def __init__(self, parent, state, datamanager, rootobj, nodedata, displaywgts, mode): + def __init__(self, parent, datamanager, rootobj, nodedata, displaywgts, mode): toolframe.toolFrame.__init__(self, parent, -1, "Product: ", wxDefaultPosition, wxSize(750, 620)) self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") self.CentreOnParent() - self.State = state self.Parent = parent if datamanager: @@ -84,22 +84,22 @@ self.partslisttree = None self.doctree = None - self.partform = partform.PartForm(self.editnb, -1, self.State) + self.partform = partform.PartForm(self.editnb, -1) self.editnb.AddPage(self.partform, "Part") - self.modelform = modelform.ModelForm(self.editnb, -1, self.State) + self.modelform = modelform.ModelForm(self.editnb, -1) self.editnb.AddPage(self.modelform, "Model") - self.propertiesform = propertiesform.PropertiesForm(self.editnb, -1, self.State) + self.propertiesform = propertiesform.PropertiesForm(self.editnb, -1) self.editnb.AddPage(self.propertiesform, "Product Properties") - self.partslistform = partslistform.PartsListForm(self.editnb, -1, self.State) + self.partslistform = partslistform.PartsListForm(self.editnb, -1) self.editnb.AddPage(self.partslistform, "Parts Lists") - self.partslistview = partslistview.PartsListView(self.editnb, -1, self.State) + self.partslistview = partslistview.PartsListView(self.editnb, -1) self.editnb.AddPage(self.partslistview, "Parts List Data") - self.documentform = docform.DocForm(self.editnb, -1, self.State) + self.documentform = docform.DocForm(self.editnb, -1) self.editnb.AddPage(self.documentform, "Documents") #notebook page indices @@ -487,7 +487,7 @@ self.dm.creatingDocument = True def SecureMode(self): - actions = self.Parent.WatchDog.GetActions(self.State.currentprojectname) + actions = self.Parent.WatchDog.GetActions(state['currentprojectname']) self.partform.SetAllowed(actions) self.modelform.SetAllowed(actions) self.partslistform.SetAllowed(actions) @@ -561,17 +561,17 @@ link.state = objectstatus.ADD self.dm.add([link]) - self.dm.addProjectObjects(self.State.currentprojectname, [link]) + self.dm.addProjectObjects(state['currentprojectname'], [link]) # replace all this with the above line --vwk # allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] +# if allprojlist.has_key(state['currentprojectname']): +# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] # if len(projlist) == 0: # projlist = {} # else: # projlist = {} # projlist[link.pgef_oid] = link.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist +# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist rootdata = self.tree.GetPyData(self.tree.GetRootItem()) parent = self.dm.getLookupObject(rootdata[1]) @@ -763,20 +763,20 @@ link.product = "ROOT" #self.rootitemid link.document = self.currentobj.pgef_oid link.state = objectstatus.ADD - link.initObject(self.State.currentprojectname, self.dm.user.id) + link.initObject(state['currentprojectname'], self.dm.user.id) self.dm.add([link]) - self.dm.addProjectObjects(self.State.currentprojectname, [link]) + self.dm.addProjectObjects(state['currentprojectname'], [link]) # replace all this with the above line --vwk # allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] +# if allprojlist.has_key(state['currentprojectname']): +# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] # if len(projlist) == 0: # projlist = {} # else: # projlist = {} # projlist[link.pgef_oid] = link.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist +# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist node = self.partslisttree.GetSelection() rootnode = self.partslisttree.GetRootItem() @@ -807,7 +807,7 @@ #print "itemedit.onpartslistview" self.editnb.SetSelection(self.PartDataPage) self.partslistview._loggedin = self.dm.user._loggedin - self.partslistview.GetData(self.State.workingdir, self.currentobj, self.dm.user, + self.partslistview.GetData(state['workingdir'], self.currentobj, self.dm.user, self.dm.serverName, self.dm.serverPort) def OnNewPart(self, event): @@ -882,7 +882,7 @@ else: self.ImportPartsListFrame.sb.ClearServer() - self.PLMtool = PLMTool(self.ImportPartsListFrame, self, self.State, self.dm, + self.PLMtool = PLMTool(self.ImportPartsListFrame, self, self.dm, -1, wxDefaultPosition, defsize) self.PLMtool.SetColumnInfo(self.currentobj._ColumnInfo, self.partslistview.partslistgrid.GetNumberCols()) self.ImportPartsListFrame.CentreOnParent() @@ -1328,17 +1328,17 @@ self.dm.creatingDocument = False self.dm.add([save_object]) - self.dm.addProjectObjects(self.State.currentprojectname, [save_object]) + self.dm.addProjectObjects(state['currentprojectname'], [save_object]) # replace all this with the above line --vwk # allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] +# if allprojlist.has_key(state['currentprojectname']): +# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] # if len(projlist) == 0: # projlist = {} # else: # projlist = {} # projlist[save_object.pgef_oid] = save_object.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist +# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist self.Parent.GetPSMTool().UpdateWgts(save_object) return True @@ -1496,17 +1496,17 @@ self.currentobj(**save_object.__dict__) self.tempobj(**save_object.__dict__) - self.dm.addProjectObjects(self.State.currentprojectname, [save_object]) + self.dm.addProjectObjects(state['currentprojectname'], [save_object]) # replace all this with the above line --vwk # allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] +# if allprojlist.has_key(state['currentprojectname']): +# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] # if len(projlist) == 0: # projlist = {} # else: # projlist = {} # projlist[save_object.pgef_oid] = save_object.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist +# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist return save_object Index: PanGalactic/pangalactic/client/modules/psm/propertiesform.py diff -u PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.16 PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.17 --- PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.16 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/propertiesform.py Thu Aug 12 15:46:16 2004 @@ -9,12 +9,10 @@ class PropertiesForm(wxPanel): - def __init__(self, parent, id, state, pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, pos=wxPyDefaultPosition, + size=wxPyDefaultSize, style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state - #self.dm = None self._loggedin = False self.propertiesgrid = wxGrid(self, ID_FOREIGN_PROPERTIES) @@ -42,8 +40,10 @@ # print workingdir, component.pgpdm_oid, user.identification, host, port self.nrows = 0 - dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(400, 75), wxTHICK_FRAME) - msg = wxStaticText(dlg, -1, "Please wait while PGEF retrieves the data...", + dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, + wxSize(400, 75), wxTHICK_FRAME) + msg = wxStaticText(dlg, -1, + "Please wait while PGEF retrieves the data...", wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) dlg.Centre() dlg.Show(True) @@ -51,13 +51,15 @@ datafile = None self.propertiesgrid.ClearGrid() - self.propertiesgrid.DeleteRows(0, self.propertiesgrid.GetNumberRows()-1) + self.propertiesgrid.DeleteRows(0, + self.propertiesgrid.GetNumberRows()-1) try: try: tmpdir = os.path.join(workingdir, "tmp") - datafilename = os.path.join(tmpdir, component.pgef_oid + ".properties") + datafilename = os.path.join(tmpdir, + component.pgef_oid + ".properties") print "properties file: " + datafilename if os.path.exists(datafilename): @@ -65,9 +67,12 @@ pass else: if self._loggedin: - #print "logged in" - #print tmpdir, component.pgpdm_oid, user.identification, host, port - retval = httpdownload.DownloadFile(tmpdir, component.pgef_oid + ".properties", user, host, port, "property") + # print "logged in" + # print tmpdir, component.pgpdm_oid, \ + # user.identification, host, port + retval = httpdownload.DownloadFile(tmpdir, + component.pgef_oid + ".properties", + user, host, port, "property") #print "retval", retval else: #print "not logged in" @@ -97,8 +102,9 @@ datarow = datafile.readline() datarow = datarow.strip() self.headers = list(datarow.split("\t")) - #print "setting default headers" - #self.headers = ["Name", "Value", "Unit"] # tbd commment this out when we actually have properties + # print "setting default headers" + # tbd commment this out when we actually have properties + # self.headers = ["Name", "Value", "Unit"] maxcol = self.propertiesgrid.GetNumberCols() if self.ncols > maxcol: @@ -120,10 +126,12 @@ ncols = len(datacells) if ncols > maxcol: for col in range(maxcol): - self.propertiesgrid.SetCellValue(self.nrows, col, datacells[col]) + self.propertiesgrid.SetCellValue(self.nrows, + col, datacells[col]) else: for col in range(ncols): - self.propertiesgrid.SetCellValue(self.nrows, col, datacells[col]) + self.propertiesgrid.SetCellValue(self.nrows, + col, datacells[col]) self.nrows += 1 if self.nrows >= self.propertiesgrid.GetNumberRows(): @@ -163,4 +171,6 @@ for row in range(self.nrows): for col in range(self.ncols): - self.propertiesgrid.SetCellValue(row, col, testname + "." + str(row) + "-" + str(col)) + self.propertiesgrid.SetCellValue(row, col, + testname + "." + str(row) + "-" + str(col)) + Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.112 PanGalactic/pangalactic/client/fnord.py:1.113 --- PanGalactic/pangalactic/client/fnord.py:1.112 Thu Aug 12 13:30:04 2004 +++ PanGalactic/pangalactic/client/fnord.py Thu Aug 12 15:46:15 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.112 2004/08/12 17:30:04 waterbug Exp $ +# $Id: fnord.py,v 1.113 2004/08/12 19:46:15 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.112 $ +@version: $Revision: 1.113 $ """ -__version__ = "$Revision: 1.112 $"[11:-2] +__version__ = "$Revision: 1.113 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -28,6 +28,7 @@ from pangalactic.utils.serverclass import * from pangalactic.utils.aboutbox import AboutBox from pangalactic.utils.changepasswd import ChangePasswd +from pangalactic.utils.pgefstate import state, readState, writeState from pangalactic.utils.preferences import prefs, readPrefs, writePrefs from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.usersearchframe import UserSearchFrame @@ -39,7 +40,6 @@ from pangalactic.client.modules.psm import searchframe from pangalactic.client.modules.psm import psmtool -from pangalactic.utils.pgefstate import PgefState workingdir = os.getcwd() @@ -180,12 +180,13 @@ wxFrame.__init__(self, parent, ID, title,pos, size) try: + readState() + state['workingdir'] = workingdir self.secure = 1 self.WorkInProgress = False self.SearchFrame = None self.CacheFrame = None self.psmtool = None - self.State = PgefState(workingdir=workingdir) self.Closing = False self.ImportPartsListFrame = None wxInitAllImageHandlers() @@ -286,8 +287,6 @@ if dlg.ShowModal() == wxID_OK: prefs['userid'] = username.GetValue() prefs['email'] = email.GetValue() - - writePrefs() dlg.Destroy() useroid = prefs.get('email', @@ -300,13 +299,14 @@ print 'fnord: user =' print self.user oid.setOidBase(useroid) - self.State.currentprojectname = ( - prefs.get('lastproject', None) or - prefs.get('defaultproject', 'NOPROJECT')) - print 'fnord: current project =', self.State.currentprojectname + state['currentprojectname'] = prefs.get('lastproject', + None) or prefs.get( + 'defaultproject', + 'NOPROJECT') + print 'fnord: current project =', state['currentprojectname'] self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, - projectid=self.State.currentprojectname) + projectid=state['currentprojectname']) self.ActivateTool() self.OnServerCombo() show_tooltips = prefs.get("ShowToolTips", False) @@ -345,7 +345,13 @@ tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER) tb.AddControl(wxStaticText(tb, -1, " Repository: ")) self.ToolbarServerID = wxNewId() - tb.AddControl(wxComboBox(tb, self.ToolbarServerID, "", choices=[self.dm.serverName, "Local"], + tb.AddControl(wxComboBox(tb, + self.ToolbarServerID, + "", + choices=[''.join([self.dm.serverName, + ':', + self.dm.serverPort]), + "Local"], size=(150,-1), style=wxCB_DROPDOWN|wxCB_READONLY)) tb.Realize() @@ -439,7 +445,7 @@ self.psmtool.ExportProperties() def OnServerCombo(self, event=None): - print "fnord.OnServerCombo, State =", self.State + print "fnord.OnServerCombo, state =", state if self.dm.inLocalMode: print "DM in local mode" self.psmtool.SetupForLocalMode() @@ -516,7 +522,6 @@ else: wxToolTip_Enable(False) prefs["ShowToolTips"] = False - writePrefs() event.Skip() def OnShowLoginConfirmed(self, event): @@ -526,7 +531,6 @@ prefs['ShowLoginConfirmed'] = True else: prefs['ShowLoginConfirmed'] = False - writePrefs() def OnSetUserId(self, event): @@ -538,7 +542,6 @@ dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['userid'] = dlg.GetValue() - writePrefs() dlg.Destroy() @@ -722,7 +725,6 @@ dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['outputdir'] = dlg.GetValue() - writePrefs() dlg.Destroy() def OnProxySettings(self, event): @@ -747,16 +749,11 @@ errdlg.ShowModal() else: prefs['proxy'] = server + ':' + port - writePrefs() def OnServerSettings(self, event): dlg = ServerDialog(self, -1, 'Enter Server Information') - server = prefs.get('server', None) - if server: - servername, serverport = server.split(':') - else: - servername = "localhost" - serverport = str(8080) + servername = prefs.get('server', 'localhost') + serverport = prefs.get('port', str(8080)) dlg.GetTextctrlServer().SetValue(servername) dlg.GetTextctrlPort().SetValue(serverport) @@ -773,10 +770,8 @@ errdlg.CentreOnParent() errdlg.ShowModal() else: - prefs['server'] = server + ':' + port - writePrefs() - self.dm.serverName = server - self.dm.serverPort = port + prefs['server'] = server + prefs['port'] = port def OnSize(self, event): @@ -966,7 +961,6 @@ ).GetValue() self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, dialog.GetCheckboxConfirmed().GetValue()) - writePrefs() self.secure = dialog.GetCheckboxUseSSL().GetValue() self.dm.serverName = dialog.GetRepository().GetStringSelection() self.dm.user.id = dialog.GetTextctrlUsername().GetValue() @@ -1000,7 +994,10 @@ self.menuBar.Enable(ID_PREF_PASSWD, loggedin) self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, loggedin) - self.sb.SetServer('Repository: ' + self.dm.serverName) + self.sb.SetServer(''.join(['Repository: ', + self.dm.serverName, + ':', + self.dm.serverPort])) self.sb.ShowImage(True) self.psmtool.UpdateForLogin() self.addSpecialMenus(self.dm.user) @@ -1011,10 +1008,14 @@ dialog.Destroy() still_trying = False if prefs.get('ShowLoginConfirmed', None): - if self.State.currentprojectname: - sdlg = wxMessageDialog(self, "Login successful.", "Yay!", wxOK) + if state.get('currentprojectname', None): + sdlg = wxMessageDialog(self, + "Login successful.", + "Yay!", wxOK) else: - sdlg = wxMessageDialog(self, "Login successful. Select a project.", "Yay", wxOK) + sdlg = wxMessageDialog(self, + "Login successful. Select a project.", + "Yay", wxOK) sdlg.CentreOnParent() sdlg.ShowModal() sdlg.Destroy() @@ -1023,15 +1024,18 @@ def OnClose(self, event): - """OnClose method that handles all the work that is required before - we can successfully close down the application""" - - #since we call close from inside this method, we use the guard variable self.Closing - #to skip the event if we are already working on closing down. + """ + OnClose method that handles all the work that is required before we + can successfully close down the application. + """ + # since we call close from inside this method, we use the guard + # variable self.Closing to skip the event if we are already working + # on closing down. if self.Closing: event.Skip() else: writePrefs() + writeState() if not self.WorkInProgress: #clean up the [tsv, properties, xls] files in the tmp directory tmpfiles = os.listdir(os.path.join(workingdir, "tmp")) @@ -1063,7 +1067,7 @@ dlg.Destroy() def ActivateTool(self): - print "fnord.ActivateTool, State =", self.State + print "fnord.ActivateTool, State =", state if self.psmtool and self.psmtool.IsShown(): return @@ -1071,7 +1075,7 @@ self.psmtool.Show(True) else: pos = wxPoint(0,0) - self.psmtool = psmtool.CreateTool(self, self.dm, self.State, -1, pos) + self.psmtool = psmtool.CreateTool(self, self.dm, -1, pos) self.ProcessEvent(wxSizeEvent(self.GetSize())) self.SetTitle (PGEF_TITLE) Index: PanGalactic/pangalactic/client/modules/psm/partslistview.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.17 PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.18 --- PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.17 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistview.py Thu Aug 12 15:46:16 2004 @@ -6,6 +6,7 @@ from pangalactic.client.modules.psm.partslistview_wdr import * import pangalactic.client.support.httpdownload as httpdownload +from pangalactic.utils.pgefstate import state try: import pangalactic.client.modules.plm.ms2file as ms2file @@ -14,11 +15,10 @@ class PartsListView(wxPanel): - def __init__(self, parent, id, state, pos = wxPyDefaultPosition, size = wxPyDefaultSize, + def __init__(self, parent, id, pos = wxPyDefaultPosition, size = wxPyDefaultSize, style = wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state #self.dm = None self._loggedin = False @@ -269,7 +269,7 @@ if filename: outfilename = filename else: - outfilename = os.path.join(self.State.workingdir, "tmp", "tmp.tsv") + outfilename = os.path.join(state['workingdir'], "tmp", "tmp.tsv") self.TabDelimFile(outfilename, grid, skipcols) # start excel; open a worksheet using the tmp file as input Index: PanGalactic/pangalactic/client/modules/psm/projectframe.py diff -u PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.9 PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.10 --- PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.9 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/projectframe.py Thu Aug 12 15:46:16 2004 @@ -2,15 +2,16 @@ from projectinfo_wdr import * import pangalactic.utils.toolframe as toolframe +from pangalactic.utils.pgefstate import state class ProjectFrame(toolframe.toolFrame): - def __init__(self, parent, state, project, datamanager): - toolframe.toolFrame.__init__(self, parent, -1, "Project: ", wxDefaultPosition, wxSize(300, 250)) + def __init__(self, parent, project, datamanager): + toolframe.toolFrame.__init__(self, parent, -1, "Project: ", + wxDefaultPosition, wxSize(300, 250)) print "projectframe.init" self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') self.CentreOnParent() - self.State = state #self.dm = datamanager self.ProjectInfo = None self.mainpanel = wxPanel(self, -1) @@ -45,10 +46,13 @@ self.Show(False) def GetCodeWgt(self): - return wxPyTypeCast(self.FindWindowById(PROJCODE_TEXTCTRL), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(PROJCODE_TEXTCTRL), + "wxTextCtrl" ) def GetNameWgt(self): - return wxPyTypeCast(self.FindWindowById(PROJNAME_TEXTCTRL), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(PROJNAME_TEXTCTRL), + "wxTextCtrl" ) def GetCenterWgt(self): - return wxPyTypeCast(self.FindWindowById(PROJCENTER_TEXTCTRL), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(PROJCENTER_TEXTCTRL), + "wxTextCtrl" ) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.172 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.173 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.172 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Thu Aug 12 15:46:16 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.172 $"[11:-2] +__version__ = "$Revision: 1.173 $"[11:-2] import os @@ -40,6 +40,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils import toolframe from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.utils import pgdialogs from pangalactic.utils import ToolkitImages from pangalactic.utils.mixin_security import Security_Mixin @@ -93,8 +94,8 @@ prefs = prefs CurrentProjectName = "" -def CreateTool(parent, datamgr, state, ID, pos): - return PSMTool(parent, datamgr, state, ID, pos, wxSize(1,1)) +def CreateTool(parent, datamgr, ID, pos): + return PSMTool(parent, datamgr, ID, pos, wxSize(1,1)) class PSMTool(wxPanel, Security_Mixin): @@ -102,12 +103,11 @@ ID_WINDOW_TOP = wxNewId() ID_WINDOW_LEFT = wxNewId() - def __init__(self, parent, datamgr, state, ID, pos, size): + def __init__(self, parent, datamgr, ID, pos, size): wxPanel.__init__(self, parent, ID, pos, size) self.Parent = parent self.dm = datamgr - self.State = state self.itemeditform = None self.SearchFrame = None @@ -377,10 +377,13 @@ return #import partslistview - temp = partslistview.PartsListView(self, -1, self.State) + temp = partslistview.PartsListView(self, -1) temp.Show(False) - temp.ExportAsExcel(event = None, grid = currentgrid, skipcols = None, - filename = None, defaultfname = self.State.currentprojectname + '_parts') + temp.ExportAsExcel(event=None, + grid=currentgrid, + skipcols=None, + filename=None, + defaultfname = state['currentprojectname'] + '_parts') if temp.exportpath: fullpath = temp.exportpath temp.Destroy() @@ -389,7 +392,10 @@ return fdlg = wxFileDialog(self, "Choose a file", fullpath, - self.State.currentprojectname + '_properties' + ".xls", "*.xls", wxSAVE) + ''.join([state['currentprojectname'], + '_properties', '.xls']), + '*.xls', + wxSAVE) if fdlg.ShowModal() == wxID_OK: filename = fdlg.GetPath() fdlg.Destroy() @@ -402,30 +408,40 @@ pid = currentgrid.GetObjectOid(row) prod_obj = currentgrid.getObject(row) prod_id = prod_obj.id - retval = httpdownload.DownloadFile(os.path.join(self.State.workingdir, 'tmp'), - pid + '.properties', - self.dm.user, self.dm.serverName, - self.dm.serverPort, "properties") + retval = httpdownload.DownloadFile( + os.path.join(state['workingdir'], 'tmp'), + pid + '.properties', + self.dm.user, self.dm.serverName, + self.dm.serverPort, "properties") if retval == 200: - files.append([prod_id, os.path.join(self.State.workingdir, 'tmp', (pid + '.properties'))]) + files.append([prod_id, + os.path.join(state['workingdir'], + 'tmp', + (pid + '.properties'))]) if len(files) > 0: try: #from modules.plm.ms2file import Data2MS temp = Data2MS(xlsfilename = filename) - temp.ExportMultipleFiles(files, singleworkbook = True, showexcel = False) + temp.ExportMultipleFiles(files, + singleworkbook=True, + showexcel=False) cdlg = wxMessageDialog(self, "Export Complete", "", wxOK) cdlg.ShowModal() cdlg.Destroy() except: - edlg = wxMessageDialog(self, "Excel... What's that?", "", wxOK | wxICON_ERROR) + edlg = wxMessageDialog(self, + "Excel... What's that?", + "", + wxOK | wxICON_ERROR) edlg.CentreOnParent() edlg.ShowModal() edlg.Destroy() else: - edlg = wxMessageDialog(self, "No properties were found for export.", + edlg = wxMessageDialog(self, + "No properties were found for export.", "Export Properties Error", wxOK | wxICON_EXCLAMATION) edlg.ShowModal() @@ -441,47 +457,52 @@ # popup help seems to be ignored.... grrrr menu = wxMenu() - menu.Append(ID_TREE_RIGHTPOPUP_EDIT, 'Edit...', "Edit this Part") - menu.Append(ID_TREE_RIGHTPOPUP_SHOWPROJECT, 'View Project Data...', "View project data") - menu.Append(ID_TREE_RIGHTPOPUP_DUMPTOPDF, 'Generate PDF...', 'Show the PDF creation options') - menu.SetHelpString(ID_TREE_RIGHTPOPUP_EDIT, "Edit this Part") - menu.SetHelpString(ID_TREE_RIGHTPOPUP_SHOWPROJECT, "View Project Data") + menu.Append(ID_TREE_RIGHTPOPUP_EDIT, + 'Edit...', "Edit this Part") + menu.Append(ID_TREE_RIGHTPOPUP_SHOWPROJECT, + 'View Project Data...', "View project data") + menu.Append(ID_TREE_RIGHTPOPUP_DUMPTOPDF, + 'Generate PDF...', 'Show the PDF creation options') + menu.SetHelpString(ID_TREE_RIGHTPOPUP_EDIT, + "Edit this Part") + menu.SetHelpString(ID_TREE_RIGHTPOPUP_SHOWPROJECT, + "View Project Data") self.PopupMenuXY(menu, event.GetX(), event.GetY()) def SecureMenu(self): - project = self.topWindow.toppanel.GetProjectWidget().GetStringSelection() + project = self.topWindow.toppanel.GetProjectWidget( + ).GetStringSelection() self.AllowedActions = self.Parent.WatchDog.GetActions(project) if self.Allowed(actions.ADDALL): - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPART, True) - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWMODEL, True) - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) - + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPART, True) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWMODEL, True) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) else: if self.Allowed(actions.ADDITEM): pass else: - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPART, False) - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWMODEL, False) - + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPART, False) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWMODEL, False) if self.Allowed(actions.ADDPARTSLIST): - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) else: - self.Parent.menuBar.Enable(sys.modules['__main__'].ID_FILE_NEWPARTSLIST, False) - -# if self.Allowed(actions.ADDDOCUMENT): ## vwk - need alert access flag -# self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, True) -# else: -# self.Parent.menuBar.Enable(sys.modules['__main__'].ID_TOOL_ALERTS, False) - + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPARTSLIST, False) if not self.Allowed(actions.DELETEITEM): pass def RebuildMainTree(self): #print "psmtool.rebuildmaintree" - projectndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() + projectndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() if projectndx > 0: itemndx = self.topWindow.toppanel.GetItemWidget().GetSelection() if itemndx > 0: @@ -490,7 +511,7 @@ self.showItem(itemobj) def OnShowProjectFrame(self, event): - self.ShowProjectFrame(self.State.currentprojectname) + self.ShowProjectFrame(state['currentprojectname']) def ShowProjectFrame(self, project): if self.projectframe: @@ -501,7 +522,6 @@ self.projectframe.Setup(project) else: self.projectframe = projectframe.ProjectFrame(self.Parent, - self.State, project, self.dm) self.projectframe.Show(True) @@ -522,7 +542,6 @@ self.itemeditform.Show(True) else: self.itemeditform = itemeditframe.ItemEditFrame(self.Parent, - self.State, self.dm, rootobj, nodedata, @@ -549,8 +568,8 @@ def OnNewPartsList(self): #print "psmtool.onnewparts" - #print "currentproject", self.State.currentprojectname, self.State.currentproject - foo = partslisttreeframe.PartsListTreeFrame(self.Parent, self.State, self.dm) + #print "currentproject", state['currentprojectname'] + foo = partslisttreeframe.PartsListTreeFrame(self.Parent, state, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -558,8 +577,8 @@ def OnNewDoc(self): - #print "psmtool.onnewdoc", self.State.currentprojectname - foo = documenttreeframe.DocumentTreeFrame(self.Parent, self.State, self.dm) + #print "psmtool.onnewdoc", state['currentprojectname'] + foo = documenttreeframe.DocumentTreeFrame(self.Parent, state, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -646,8 +665,8 @@ objlist = objectlist if len(objlist) > 0: - self.dm.setCurrentProject(self.State.currentprojectname) - self.dm.setState(self.State) + self.dm.setCurrentProject(state['currentprojectname']) + self.dm.setState(state) retval = self.dm.commit(objlist) # change the grid background colour to the default colour @@ -689,7 +708,7 @@ self.tree.DeleteAllItems() self.itemgrid.ClearGrid() self.modelgrid.ClearGrid() - self.State.currentuser = self.dm.user.id + state['currentuser'] = self.dm.user.id self.OnSelectProject() @@ -707,7 +726,7 @@ else: #print "looking for children" - self.dm.setCurrentProject(self.State.currentprojectname) + self.dm.setCurrentProject(state['currentprojectname']) treetuple = self.tree.GetPyData(node) obj = self.dm.getLookupObject(treetuple[1]) if not self.inLocalMode(): @@ -877,10 +896,10 @@ project = wgt.GetStringSelection() ndx = wgt.GetSelection() if ndx == 0: - if self.State.currentprojectname: - wgt.SetStringSelection(self.State.currentprojectname) - wgt.SetSelection(wgt.FindString(self.State.currentprojectname)) - self.dm.setCurrentProject(self.State.currentprojectname) + if state['currentprojectname']: + wgt.SetStringSelection(state['currentprojectname']) + wgt.SetSelection(wgt.FindString(state['currentprojectname'])) + self.dm.setCurrentProject(state['currentprojectname']) project = wgt.GetStringSelection() ndx = wgt.GetSelection() @@ -916,8 +935,7 @@ dlg.CentreOnParent() dlg.Show(True) - self.State.currentprojectname = projectname - self.dm.saveState(self.State) + state['currentprojectname'] = projectname self.dm.getItemsByProject([projectname]) self.tree.DeleteAllItems() @@ -950,8 +968,7 @@ if ndx > 0: projectname = self.topWindow.toppanel.GetProjectWidget().GetStringSelection() - self.State.currentprojectname = projectname - self.dm.saveState(self.State) + state['currentprojectname'] = projectname numitems = self.FillGridFromProject(projectname) self.FillItemWidgetFromProject(projectname) @@ -969,7 +986,7 @@ def UpdateWindows(self): if self.projectframe: - self.projectframe.Setup(self.State.currentprojectname) + self.projectframe.Setup(state['currentprojectname']) if self.itemeditform: self.itemeditform.OnClose() @@ -1124,16 +1141,16 @@ self.Parent.sb.SetServer('Local') self.tree.DeleteAllItems() - self.State.currentuser = self.dm.user.id + state['currentuser'] = self.dm.user.id wgt = self.Parent.menuBar.FindMenuItem('Repository','Get Marked Items') self.Parent.menuBar.Enable(wgt, False) wgt = self.topWindow.toppanel.GetProjectWidget() - if self.State.currentprojectname: - ndx = wgt.FindString(self.State.currentprojectname) + if state['currentprojectname']: + ndx = wgt.FindString(state['currentprojectname']) if ndx <> wxNOT_FOUND: - wgt.SetSelection(wgt.FindString(self.State.currentprojectname)) - wgt.SetStringSelection(self.State.currentprojectname) + wgt.SetSelection(wgt.FindString(state['currentprojectname'])) + wgt.SetStringSelection(state['currentprojectname']) ndx = wgt.GetSelection() projectname = wgt.GetStringSelection() Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.105 PanGalactic/pangalactic/utils/localdb.py:1.106 --- PanGalactic/pangalactic/utils/localdb.py:1.105 Wed Aug 11 02:21:11 2004 +++ PanGalactic/pangalactic/utils/localdb.py Thu Aug 12 15:46:16 2004 @@ -38,7 +38,7 @@ "WfEventAudit"] EXCLUDE_CLASSES = ["ACUByAssembly", "DisplayConfig", "Passwd", - "UncommittedDocumentIDs", "OidLookup", "State"] + "UncommittedDocumentIDs", "OidLookup"] class LocalStorage: @@ -64,7 +64,6 @@ PROJECT = "Project" PROJECTOBJECTS = "ProjectObjects" PGEFROLE = "PgefRole" - STATE = "State" UNCOMMITTEDDOCUMENTIDS = "UncommittedDocumentIDs" UNCOMMITTEDOBJECTS = "UncommittedObjects" USER = "User" @@ -94,7 +93,6 @@ (PROJECT, 0, admin), (PROJECTOBJECTS, 0, god), (PGEFROLE, 0, admin), - (STATE, 0, god), (UNCOMMITTEDDOCUMENTIDS, 1, god), (UNCOMMITTEDOBJECTS, 1, user), (USER, 0, admin), @@ -186,10 +184,6 @@ if user: self.saveDict(self.USER, user) - def SaveState(self, state): -# print "localdb.savestate", state.pgef_oid - self.saveDict(self.STATE, state) - def SaveRoles(self, RolesList = None): # print "localdb.saveroles" if RolesList: Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.139 PanGalactic/pangalactic/utils/datamanager.py:1.140 --- PanGalactic/pangalactic/utils/datamanager.py:1.139 Thu Aug 12 13:30:06 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Thu Aug 12 15:46:16 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.139 $ +@version: $Revision: 1.140 $ """ -__version__ = "$Revision: 1.139 $"[11:-2] +__version__ = "$Revision: 1.140 $"[11:-2] import time import mx.DateTime @@ -72,11 +72,8 @@ self.watchdog = watchdog or SecurityManager() self.watchdog.inLocalMode = self.inLocalMode self.user = self.watchdog.user - self.serverName = "localhost" - self.serverPort = None - servernameandport = prefs.get('server', None) - if servernameandport: - self.serverName, self.serverPort = servernameandport.split(":") + self.serverName = prefs.get('server', 'localhost') + self.serverPort = prefs.get('port', '8080') self.server = None self.refresh = False self.CurrentProject = None @@ -94,19 +91,12 @@ def _createServer(self, username, password, secure=1): - server = prefs.get('server', None) - if server: - self.serverName, self.serverPort = server.split(':') - else: - self.serverPort = "8080" - - proxy = prefs.get('proxy', None) - if proxy: - proxyhost, proxyport = proxy.split(':') - else: - proxyhost = None - proxyport = None - + """ + Initialize a server proxy. + """ + # TODO: implement HTTP proxy handling + proxyhost = prefs.get('proxyhost', None) + proxyport = prefs.get('proxyport', None) return XmlrpcInterface(self.serverName, self.serverPort, username, @@ -119,13 +109,6 @@ def getRoot(self): return self.localDB.dbroot - def setState(self, state): - self.State = state - - def saveState(self, state): - #print "dm.savestate", state.pgef_oid - self.localDB.SaveState(state) - def getPasswd(self, pwd_id): return self.localDB.getPasswd(pwd_id) @@ -166,7 +149,7 @@ def getServerList(self): - return [self.serverName] + return [':'.join([self.serverName, self.serverPort])] def getRoles(self): return self.localDB.getDict(self.localDB.ROLE) From waterbug at ned.gsfc.nasa.gov Thu Aug 12 17:25:19 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 12 17:25:22 2004 Subject: [Pangalactic-commits] More refurbishing of states. Message-ID: <200408122125.i7CLPJHm010544@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.113 1.114 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py 1.11 1.12 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.22 1.23 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.146 1.147 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.36 1.37 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.173 1.174 PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py 1.4 1.5 PanGalactic/pangalactic/client/tests/test_datamanager.py 1.11 1.12 PanGalactic/pangalactic/client/tests/test_itemeditframe.py 1.18 1.19 PanGalactic/pangalactic/utils/datamanager.py 1.140 1.141 PanGalactic/pangalactic/utils/proxyclass.py 1.4 1.5 PanGalactic/pangalactic/utils/serverclass.py 1.4 1.5 PanGalactic/pangalactic/utils/serverdialog_wdr.py 1.4 1.5 Log message: More refurbishing of states. Index: PanGalactic/pangalactic/client/tests/test_itemeditframe.py diff -u PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.18 PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.19 --- PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.18 Sun Aug 8 22:53:46 2004 +++ PanGalactic/pangalactic/client/tests/test_itemeditframe.py Thu Aug 12 17:25:17 2004 @@ -80,7 +80,7 @@ testframe = wxFrame(None, -1, 'Test Frame') testframe.State = pgefstate.PgefState() testframe.dm = datamanager.DataManager(testframe, true) - testframe.dm.serverName = 'ned.gsfc.nasa.gov' + testframe.dm.serverHost = 'ned.gsfc.nasa.gov' testframe.dm.serverPort = '8080' #testframe.dm.createServer() testframe.WatchDog = securitymanager.SecurityManager(testframe.dm) @@ -278,7 +278,7 @@ testframe = wxFrame(None, -1, 'Test Frame') testframe.State = pgefstate.PgefState() testframe.dm = datamanager.DataManager(testframe, true) - testframe.dm.serverName = 'ned.gsfc.nasa.gov' + testframe.dm.serverHost = 'ned.gsfc.nasa.gov' testframe.dm.serverPort = '8080' #testframe.dm.createServer() testframe.WatchDog = securitymanager.SecurityManager(testframe.dm) @@ -299,7 +299,7 @@ testframe.State = pgefstate.PgefState() testframe.dm = datamanager.DataManager(testframe, true) testframe.dm = datamanager.DataManager(testframe, true) - testframe.dm.serverName = 'ned.gsfc.nasa.gov' + testframe.dm.serverHost = 'ned.gsfc.nasa.gov' testframe.dm.serverPort = '8080' #testframe.dm.createServer() testframe.WatchDog = securitymanager.SecurityManager(testframe.dm) Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.146 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.147 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.146 Thu Aug 12 15:46:15 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Thu Aug 12 17:25:16 2004 @@ -1,6 +1,6 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.146 $"[11:-2] +__version__ = "$Revision: 1.147 $"[11:-2] import copy import types @@ -808,7 +808,7 @@ self.editnb.SetSelection(self.PartDataPage) self.partslistview._loggedin = self.dm.user._loggedin self.partslistview.GetData(state['workingdir'], self.currentobj, self.dm.user, - self.dm.serverName, self.dm.serverPort) + self.dm.serverHost, self.dm.serverPort) def OnNewPart(self, event): """ @@ -878,7 +878,10 @@ self.ImportPartsListFrame.SetDataManager(self.dm) if self.dm.user._loggedin: - self.ImportPartsListFrame.sb.SetServer(self.dm.serverName) + self.ImportPartsListFrame.sb.SetServer( + ''.join([self.dm.serverHost, + ':', + self.dm.serverPort])) else: self.ImportPartsListFrame.sb.ClearServer() Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.140 PanGalactic/pangalactic/utils/datamanager.py:1.141 --- PanGalactic/pangalactic/utils/datamanager.py:1.140 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Thu Aug 12 17:25:17 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.140 $ +@version: $Revision: 1.141 $ """ -__version__ = "$Revision: 1.140 $"[11:-2] +__version__ = "$Revision: 1.141 $"[11:-2] import time import mx.DateTime @@ -72,8 +72,8 @@ self.watchdog = watchdog or SecurityManager() self.watchdog.inLocalMode = self.inLocalMode self.user = self.watchdog.user - self.serverName = prefs.get('server', 'localhost') - self.serverPort = prefs.get('port', '8080') + self.serverHost = prefs.get('serverhost', 'localhost') + self.serverPort = prefs.get('serverport', '8080') self.server = None self.refresh = False self.CurrentProject = None @@ -97,7 +97,7 @@ # TODO: implement HTTP proxy handling proxyhost = prefs.get('proxyhost', None) proxyport = prefs.get('proxyport', None) - return XmlrpcInterface(self.serverName, + return XmlrpcInterface(self.serverHost, self.serverPort, username, password, @@ -149,7 +149,7 @@ def getServerList(self): - return [':'.join([self.serverName, self.serverPort])] + return [':'.join([self.serverHost, self.serverPort])] def getRoles(self): return self.localDB.getDict(self.localDB.ROLE) @@ -841,7 +841,7 @@ ctype = 'application/octet-stream' upload(localpath = file_name, - host = self.serverName, + host = self.serverHost, port = self.serverPort, srvpath = "/upload", userid = self.user.id, @@ -1094,3 +1094,4 @@ self.server.startWfActivity(wf_activity, wf_obj) else: print "NOTE: not logged in; need to queue activity" + Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.36 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.37 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.36 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Thu Aug 12 17:25:16 2004 @@ -25,7 +25,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.36 $"[11:-2] +__version__ = "$Revision: 1.37 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -200,7 +200,7 @@ self.partslistview.GetData(self.State.workingdir, self.currentdocument, self.dm.user, - self.dm.serverName, + self.dm.serverHost, self.dm.serverPort) def OnImportPartsList(self, event): @@ -216,7 +216,10 @@ self.ImportPartsListFrame.SetDataManager(self.dm) if self.dm.user._loggedin: - self.ImportPartsListFrame.sb.SetServer(self.dm.serverName) + self.ImportPartsListFrame.sb.SetServer( + ''.join([self.dm.serverHost, + ':', + self.dm.serverPort])) else: self.ImportPartsListFrame.sb.ClearServer() Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.113 PanGalactic/pangalactic/client/fnord.py:1.114 --- PanGalactic/pangalactic/client/fnord.py:1.113 Thu Aug 12 15:46:15 2004 +++ PanGalactic/pangalactic/client/fnord.py Thu Aug 12 17:25:15 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.113 2004/08/12 19:46:15 waterbug Exp $ +# $Id: fnord.py,v 1.114 2004/08/12 21:25:15 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.113 $ +@version: $Revision: 1.114 $ """ -__version__ = "$Revision: 1.113 $"[11:-2] +__version__ = "$Revision: 1.114 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -22,15 +22,15 @@ from pangalactic.utils import toolframe from pangalactic.utils import ToolkitImages from pangalactic.utils import userinfo -from pangalactic.utils.loginform_wdr import * -from pangalactic.utils.loginclass import * -from pangalactic.utils.proxyclass import * -from pangalactic.utils.serverclass import * -from pangalactic.utils.aboutbox import AboutBox -from pangalactic.utils.changepasswd import ChangePasswd -from pangalactic.utils.pgefstate import state, readState, writeState -from pangalactic.utils.preferences import prefs, readPrefs, writePrefs +from pangalactic.utils.loginform_wdr import * +from pangalactic.utils.loginclass import * +from pangalactic.utils.aboutbox import AboutBox +from pangalactic.utils.changepasswd import ChangePasswd +from pangalactic.utils.pgefstate import state, readState, writeState +from pangalactic.utils.preferences import prefs, readPrefs, writePrefs +from pangalactic.utils.proxyclass import ProxyDialog from pangalactic.utils.securitymanager import SecurityManager +from pangalactic.utils.serverclass import ServerDialog from pangalactic.utils.usersearchframe import UserSearchFrame from pangalactic.utils.datamanager import DataManager @@ -144,8 +144,8 @@ def ClearMsg(self): self.SetStatusText("", 1) - def SetServer(self, servername): - self.mytext.SetLabel(servername) + def SetServer(self, serverhost): + self.mytext.SetLabel(serverhost) def ClearServer(self): self.mytext.SetLabel(" ") @@ -181,7 +181,9 @@ try: readState() + readPrefs() state['workingdir'] = workingdir + state['mode'] = 'local' self.secure = 1 self.WorkInProgress = False self.SearchFrame = None @@ -249,8 +251,6 @@ EVT_MENU(self, ID_ADMIN_ADDUSER, self.onAdminAddUser) EVT_MENU(self, ID_ADMIN_SEARCHUSER, self.onAdminSearchUser) - readPrefs(1) - showloginconfirm = prefs.get('ShowLoginConfirmed', True) self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, int(showloginconfirm)) @@ -307,6 +307,7 @@ self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=state['currentprojectname']) + state['mode'] = 'remote' self.ActivateTool() self.OnServerCombo() show_tooltips = prefs.get("ShowToolTips", False) @@ -348,7 +349,7 @@ tb.AddControl(wxComboBox(tb, self.ToolbarServerID, "", - choices=[''.join([self.dm.serverName, + choices=[''.join([self.dm.serverHost, ':', self.dm.serverPort]), "Local"], @@ -446,13 +447,15 @@ def OnServerCombo(self, event=None): print "fnord.OnServerCombo, state =", state - if self.dm.inLocalMode: - print "DM in local mode" + print " - prefs =", prefs + print " - state =", state + if state['mode'] == 'local': + print "in local mode" self.psmtool.SetupForLocalMode() self.sb.ShowImage(False) - self.menuBar.Enable(ID_FILE_LOGIN, True) else: - print "DM in non-local mode" + print "in non-local mode" + self.menuBar.Enable(ID_FILE_LOGIN, True) self.psmtool.SetupForLogin() self.sb.ShowImage(True) @@ -731,46 +734,46 @@ dlg = ProxyDialog(self, -1, 'Enter Proxy Information') proxy = prefs.get('proxy', None) if proxy: - proxyname, proxyport = proxy.split(':') - dlg.GetTextctrlServer().SetValue(proxyname) + proxyhost, proxyport = proxy.split(':') + dlg.GetTextctrlHost().SetValue(proxyhost) dlg.GetTextctrlPort().SetValue(proxyport) dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - server = dlg.GetTextctrlServer().GetValue() + serverhost = dlg.GetTextctrlHost().GetValue() port = dlg.GetTextctrlPort().GetValue() - server.strip() + serverhost.strip() port.strip() - if server == '' or port == '': + if serverhost == '' or port == '': errdlg = wxMessageDialog(self, "A server and a port are required", "Unable to comply", wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() else: - prefs['proxy'] = server + ':' + port + prefs['proxy'] = serverhost + ':' + port def OnServerSettings(self, event): dlg = ServerDialog(self, -1, 'Enter Server Information') - servername = prefs.get('server', 'localhost') + serverhost = prefs.get('serverhost', 'localhost') serverport = prefs.get('port', str(8080)) - dlg.GetTextctrlServer().SetValue(servername) + dlg.GetTextctrlHost().SetValue(serverhost) dlg.GetTextctrlPort().SetValue(serverport) dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - server = dlg.GetTextctrlServer().GetValue() + serverhost = dlg.GetTextctrlHost().GetValue() port = dlg.GetTextctrlPort().GetValue() - server.strip() + serverhost.strip() port.strip() - if server == '' or port == '': + if serverhost == '' or port == '': errdlg = wxMessageDialog(self, "A server and a port are required", "Unable to comply", wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() else: - prefs['server'] = server + prefs['serverhost'] = serverhost prefs['port'] = port @@ -904,9 +907,6 @@ self.menuBar.Refresh() def OnLogout(self, event): - self.dm.user._loggedin = False - self.dm.inLocalMode = True - self.menuBar.Enable(ID_FILE_LOGIN, not self.dm.user._loggedin) self.menuBar.Enable(ID_PREF_PROXY, not self.dm.user._loggedin) self.menuBar.Enable(ID_PREF_SERVER1, not self.dm.user._loggedin) @@ -920,6 +920,7 @@ self.menuBar.Enable(ID_TOOL_GETMYSTUFF, self.dm.user._loggedin) self.menuBar.Enable(ID_TOOL_SEARCH, self.dm.user._loggedin) + state['mode'] = 'local' self.sb.SetServer('Local') self.OnServerCombo() @@ -962,7 +963,8 @@ self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, dialog.GetCheckboxConfirmed().GetValue()) self.secure = dialog.GetCheckboxUseSSL().GetValue() - self.dm.serverName = dialog.GetRepository().GetStringSelection() + hostport = dialog.GetRepository().GetStringSelection() + self.dm.serverHost, self.dm.serverPort = hostport.split(':') self.dm.user.id = dialog.GetTextctrlUsername().GetValue() self.dm.user._password = dialog.GetTextctrlPassword().GetValue() @@ -995,7 +997,7 @@ self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, loggedin) self.sb.SetServer(''.join(['Repository: ', - self.dm.serverName, + self.dm.serverHost, ':', self.dm.serverPort])) self.sb.ShowImage(True) @@ -1067,7 +1069,7 @@ dlg.Destroy() def ActivateTool(self): - print "fnord.ActivateTool, State =", state + print "fnord.ActivateTool, state =", state if self.psmtool and self.psmtool.IsShown(): return Index: PanGalactic/pangalactic/client/modules/plm/epimsmapping.py diff -u PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.11 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.12 --- PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.11 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/plm/epimsmapping.py Thu Aug 12 17:25:16 2004 @@ -10,12 +10,16 @@ class EpimsMapping(toolframe.toolFrame): def __init__(self, parent, id, title, datamanager): - toolframe.toolFrame.__init__(self, parent, -1, title, wxDefaultPosition, wxSize(470, 350)) + toolframe.toolFrame.__init__(self, parent, -1, title, + wxDefaultPosition, wxSize(470, 350)) self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') - self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") - self.menuBar.SetHelpString(toolframe.ID_HELP_TESTING, "NOT a good idea") + self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") + self.menuBar.SetHelpString(toolframe.ID_HELP_TESTING, + "NOT a good idea") menu = wxMenu() - menu.Append(DELETEMAPROW, "&Delete highlighted row", "Delete the selected entry") + menu.Append(DELETEMAPROW, "&Delete highlighted row", + "Delete the selected entry") self.menuBar.Insert(1, menu, "Edit") self.CentreOnParent() @@ -47,7 +51,9 @@ self.SelectedRow = None if self.dm.user._loggedin: - self.sb.SetServer(self.dm.serverName) + self.sb.SetServer(''.join([self.dm.serverHost, + ':', + self.dm.serverPort]) else: self.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.22 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.23 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.22 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Thu Aug 12 17:25:16 2004 @@ -640,7 +640,10 @@ if self.dm: if self.dm.user._loggedin: - self.EpimsMappingFrame.sb.SetServer(self.dm.serverName) + self.EpimsMappingFrame.sb.SetServer( + ''.join([self.dm.serverHost, + ':', + self.dm.serverPort])) else: self.EpimsMappingFrame.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.173 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.174 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.173 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Thu Aug 12 17:25:16 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.173 $"[11:-2] +__version__ = "$Revision: 1.174 $"[11:-2] import os @@ -411,7 +411,7 @@ retval = httpdownload.DownloadFile( os.path.join(state['workingdir'], 'tmp'), pid + '.properties', - self.dm.user, self.dm.serverName, + self.dm.user, self.dm.serverHost, self.dm.serverPort, "properties") if retval == 200: files.append([prod_id, @@ -550,7 +550,10 @@ self.itemeditform.Show(True) if self.dm.user._loggedin: - self.itemeditform.sb.SetServer(self.dm.serverName) + self.itemeditform.sb.SetServer( + ''.join([self.dm.serverHost, + ':', + self.dm.serverPort])) else: self.itemeditform.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py diff -u PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py:1.4 PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py:1.5 --- PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py:1.4 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py Thu Aug 12 17:25:16 2004 @@ -12,7 +12,7 @@ # Window functions ID_TEXT = wxNewId() -ID_TEXTCTRL_NEWSERVER = wxNewId() +ID_TEXTCTRL_NEWHOST = wxNewId() ID_TEXTCTRL_NEWPORT = wxNewId() ID_BUTTON_SERVER_OK = wxNewId() ID_BUTTON_SERVER_CANCEL = wxNewId() @@ -23,10 +23,10 @@ item2 = wxFlexGridSizer( 0, 2, 0, 0 ) - item3 = wxStaticText( parent, ID_TEXT, "Server Name", wxDefaultPosition, wxDefaultSize, 0 ) + item3 = wxStaticText( parent, ID_TEXT, "Server Host Name", wxDefaultPosition, wxDefaultSize, 0 ) item2.AddWindow( item3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ) - item4 = wxTextCtrl( parent, ID_TEXTCTRL_NEWSERVER, "", wxDefaultPosition, wxSize(140,-1), 0 ) + item4 = wxTextCtrl( parent, ID_TEXTCTRL_NEWHOST, "", wxDefaultPosition, wxSize(140,-1), 0 ) item4.SetToolTip( wxToolTip("Server IP Address") ) item2.AddWindow( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ) Index: PanGalactic/pangalactic/client/tests/test_datamanager.py diff -u PanGalactic/pangalactic/client/tests/test_datamanager.py:1.11 PanGalactic/pangalactic/client/tests/test_datamanager.py:1.12 --- PanGalactic/pangalactic/client/tests/test_datamanager.py:1.11 Fri Mar 5 16:18:12 2004 +++ PanGalactic/pangalactic/client/tests/test_datamanager.py Thu Aug 12 17:25:17 2004 @@ -52,7 +52,7 @@ def testValidLogin(self): self.dm = datamanager.DataManager(self, true) - self.dm.serverName = 'ned.gsfc.nasa.gov' + self.dm.serverHost = 'ned.gsfc.nasa.gov' self.dm.serverPort = '8080' #self.dm.createServer("tstuser", "test") self.WatchDog = securitymanager.SecurityManager(self.dm) @@ -75,7 +75,7 @@ def testFillProjectList(self): self.dm = datamanager.DataManager(self, true) - self.dm.serverName = 'ned.gsfc.nasa.gov' + self.dm.serverHost = 'ned.gsfc.nasa.gov' self.dm.serverPort = '8080' #self.dm.createServer() self.WatchDog = securitymanager.SecurityManager(self.dm) @@ -91,7 +91,7 @@ def testQuickCreate(self): self.dm = datamanager.DataManager(self, true) - self.dm.serverName = 'ned.gsfc.nasa.gov' + self.dm.serverHost = 'ned.gsfc.nasa.gov' self.dm.serverPort = '8080' #self.dm.createServer() self.WatchDog = securitymanager.SecurityManager(self.dm) @@ -109,7 +109,7 @@ # def testsetCurrentProject(self): # self.dm = datamanager.DataManager(self, true) -# self.dm.serverName = 'ned.gsfc.nasa.gov' +# self.dm.serverHost = 'ned.gsfc.nasa.gov' # self.dm.serverPort = '8080' # self.dm.createServer() # self.WatchDog = securitymanager.SecurityManager(self.dm) @@ -125,7 +125,7 @@ def testgetItemsByProject(self): self.dm = datamanager.DataManager(self, true) - self.dm.serverName = 'ned.gsfc.nasa.gov' + self.dm.serverHost = 'ned.gsfc.nasa.gov' self.dm.serverPort = '8080' #self.dm.createServer() self.WatchDog = securitymanager.SecurityManager(self.dm) Index: PanGalactic/pangalactic/utils/proxyclass.py diff -u PanGalactic/pangalactic/utils/proxyclass.py:1.4 PanGalactic/pangalactic/utils/proxyclass.py:1.5 --- PanGalactic/pangalactic/utils/proxyclass.py:1.4 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/proxyclass.py Thu Aug 12 17:25:17 2004 @@ -1,4 +1,8 @@ -from wxPython.wx import wxDialog, wxPyDefaultPosition, wxPyDefaultSize, wxDEFAULT_DIALOG_STYLE, wxPyTypeCast +from wxPython.wx import wxDialog +from wxPython.wx import wxPyDefaultPosition +from wxPython.wx import wxPyDefaultSize +from wxPython.wx import wxDEFAULT_DIALOG_STYLE +from wxPython.wx import wxPyTypeCast from proxydialog_wdr import * @@ -17,15 +21,15 @@ def GetTextctrlPort(self): return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_PORT), "wxTextCtrl" ) - def GetTextctrlServer(self): - return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_SERVER), "wxTextCtrl" ) + def GetTextctrlHost(self): + return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_HOST), "wxTextCtrl" ) def SetTextctrlPort(self, value): self.GetTextctrlPort().Clear() self.GetTextctrlPort().SetValue(value) - def SetTextctrlServer(self, value): - self.GetTextctrlServer().Clear() - self.GetTextctrlServer().SetValue(value) + def SetTextctrlHost(self, value): + self.GetTextctrlHost().Clear() + self.GetTextctrlHost().SetValue(value) # WDR: handler implementations for ProxyDialog Index: PanGalactic/pangalactic/utils/serverclass.py diff -u PanGalactic/pangalactic/utils/serverclass.py:1.4 PanGalactic/pangalactic/utils/serverclass.py:1.5 --- PanGalactic/pangalactic/utils/serverclass.py:1.4 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/serverclass.py Thu Aug 12 17:25:17 2004 @@ -18,15 +18,15 @@ def GetTextctrlPort(self): return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_NEWPORT), "wxTextCtrl" ) - def GetTextctrlServer(self): - return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_NEWSERVER), "wxTextCtrl" ) + def GetTextctrlHost(self): + return wxPyTypeCast( self.FindWindowById(ID_TEXTCTRL_NEWHOST), "wxTextCtrl" ) def SetTextctrlPort(self, value): self.GetTextctrlPort().Clear() self.GetTextctrlPort().SetValue(value) - def SetTextctrlServer(self, value): - self.GetTextctrlServer().Clear() - self.GetTextctrlServer().SetValue(value) + def SetTextctrlHost(self, value): + self.GetTextctrlHost().Clear() + self.GetTextctrlHost().SetValue(value) # WDR: handler implementations for ProxyDialog Index: PanGalactic/pangalactic/utils/serverdialog_wdr.py diff -u PanGalactic/pangalactic/utils/serverdialog_wdr.py:1.4 PanGalactic/pangalactic/utils/serverdialog_wdr.py:1.5 --- PanGalactic/pangalactic/utils/serverdialog_wdr.py:1.4 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/serverdialog_wdr.py Thu Aug 12 17:25:17 2004 @@ -12,7 +12,7 @@ # Window functions ID_TEXT = wxNewId() -ID_TEXTCTRL_NEWSERVER = wxNewId() +ID_TEXTCTRL_NEWHOST = wxNewId() ID_TEXTCTRL_NEWPORT = wxNewId() def ServerFunc( parent, call_fit = True, set_sizer = True ): @@ -21,10 +21,10 @@ item2 = wxFlexGridSizer( 0, 2, 0, 0 ) - item3 = wxStaticText( parent, ID_TEXT, "Server Name or IP", wxDefaultPosition, wxDefaultSize, 0 ) + item3 = wxStaticText( parent, ID_TEXT, "Server Host Name or IP", wxDefaultPosition, wxDefaultSize, 0 ) item2.AddWindow( item3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ) - item4 = wxTextCtrl( parent, ID_TEXTCTRL_NEWSERVER, "", wxDefaultPosition, wxSize(140,-1), 0 ) + item4 = wxTextCtrl( parent, ID_TEXTCTRL_NEWHOST, "", wxDefaultPosition, wxSize(140,-1), 0 ) item2.AddWindow( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ) item5 = wxStaticText( parent, ID_TEXT, "Port Number", wxDefaultPosition, wxDefaultSize, 0 ) From waterbug at ned.gsfc.nasa.gov Fri Aug 13 02:43:54 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 13 02:43:58 2004 Subject: [Pangalactic-commits] New state paradigm is working ... whew! :P Message-ID: <200408130643.i7D6hsiF014026@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/fnord.py 1.114 1.115 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py 1.12 1.13 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.23 1.24 PanGalactic/pangalactic/client/modules/psm/docform.py 1.6 1.7 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.38 1.39 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.147 1.148 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.11 1.12 PanGalactic/pangalactic/client/modules/psm/partform.py 1.11 1.12 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.36 1.37 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.37 1.38 PanGalactic/pangalactic/client/modules/psm/partslistview.py 1.18 1.19 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py 1.44 1.45 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py 1.20 1.21 PanGalactic/pangalactic/client/modules/psm/propertiesform.py 1.17 1.18 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.174 1.175 PanGalactic/pangalactic/client/tests/test_person.py 1.11 1.12 PanGalactic/pangalactic/client/tests/test_propertiesform.py 1.8 1.9 PanGalactic/pangalactic/enterprise/person.py 1.23 1.24 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py 1.37 1.38 PanGalactic/pangalactic/utils/datamanager.py 1.141 1.142 Log message: New state paradigm is working ... whew! :P Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.36 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.37 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.36 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Fri Aug 13 02:43:20 2004 @@ -13,11 +13,14 @@ class PartsListForm(wxPanel, Security_Mixin): - """ Dialog created with wxDesigner that is the display form for the parts list info. - the actual wxDesigner code resides in partslistform_wdr.py """ + """ + Dialog created with wxDesigner that is the display form for the parts + list info. The actual wxDesigner code resides in partslistform_wdr.py + """ - def __init__(self, parent, id, state, debug = 0, pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, debug=0, pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.debug = debug Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.23 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.24 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.23 Thu Aug 12 17:25:16 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Fri Aug 13 02:43:20 2004 @@ -13,6 +13,7 @@ from wxPython.wx import wxPyTypeCast, wxNewId, wxBeginBusyCursor, wxEndBusyCursor, wxSafeYield from wxPython.wx import wxDefaultSize, wxDefaultPosition, wxVERTICAL, wxYES_NO from wxPython.wx import EVT_BUTTON, EVT_COMBOBOX, EVT_LISTBOX, EVT_SPINCTRL, EVT_CHECKBOX, EVT_MENU +from pangalactic.utils.pgefstate import state try: from ms2file import * @@ -22,6 +23,7 @@ from pangalactic.utils import toolframe from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.client.modules.plm.ms2file_new_wdr import * from pangalactic.client.modules.plm.epimsgrid import * @@ -304,7 +306,7 @@ return self.GetName() + " (" + self.GetNickName() + ")" def UpdateForLogin(self): - if self.dm.user._loggedin: + if state['loggedin']: print "plm - updateforlogin tbd" @@ -639,7 +641,7 @@ self.EpimsMappingFrame = epimsmapping.EpimsMapping(self, -1, "Database Column Mapping", self.dm) if self.dm: - if self.dm.user._loggedin: + if state['loggedin']: self.EpimsMappingFrame.sb.SetServer( ''.join([self.dm.serverHost, ':', Index: PanGalactic/pangalactic/client/tests/test_propertiesform.py diff -u PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.8 PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.9 --- PanGalactic/pangalactic/client/tests/test_propertiesform.py:1.8 Tue Aug 10 12:13:39 2004 +++ PanGalactic/pangalactic/client/tests/test_propertiesform.py Fri Aug 13 02:43:21 2004 @@ -38,7 +38,6 @@ testframe.dm.localDB.Commit() testframe.propform = None testframe.propform = modules.psm.propertiesform.PropertiesForm(testframe, -1, state) - testframe.propform._loggedin = true testframe.propform.GetData('.', tempitem, testframe.WatchDog.user, 'ned.gsfc.nasa.gov',80) assert os.path.exists(os.path.join('.','tmp','ned.gsfc.nasa.gov__.properties')), \ Index: PanGalactic/pangalactic/client/tests/test_person.py diff -u PanGalactic/pangalactic/client/tests/test_person.py:1.11 PanGalactic/pangalactic/client/tests/test_person.py:1.12 --- PanGalactic/pangalactic/client/tests/test_person.py:1.11 Wed Aug 11 02:21:09 2004 +++ PanGalactic/pangalactic/client/tests/test_person.py Fri Aug 13 02:43:21 2004 @@ -50,7 +50,6 @@ assert len(self.obj1._pending_operations) == 0, 'Bad initial values for PendingOperations' ##==> (postgres) removed from schema assert self.obj1.RoleSet == '', 'Bad initial values for RoleSet' - assert self.obj1._loggedin == false, 'Bad initial values for LoggedIn' ##==> (postgres) removed from schema assert self.obj1.Modified == false, 'Bad initial values for Modified' assert self.obj1._authorization == None, 'Bad initial values for Authorization' Index: PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.20 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.21 --- PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.20 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py Fri Aug 13 02:43:20 2004 @@ -1,6 +1,7 @@ from wxPython.wx import wxTreeCtrl, wxTreeItemIcon_Selected, EVT_RIGHT_DOWN, wxPoint import pgeftree -import pangalactic.utils.objectstatus as objectstatus +from pangalactic.utils import objectstatus +from pangalactic.utils.pgefstate import state class PgefVersionTree(pgeftree.PgefTree): """Specialized tree for displaying versions hierarchically.""" @@ -38,7 +39,7 @@ ## if rootitem.has_parts_lists_flag: ## self.SetItemHasChildren(rootnode, True) -## if datamanager.user._loggedin: +## if state['loggedin']: ## if not self.IsExpanded(rootnode): ## links_objs = datamanager.getPartDocLinksByPartId([rootitemid]) Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.11 PanGalactic/pangalactic/client/modules/psm/partform.py:1.12 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.11 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Fri Aug 13 02:43:20 2004 @@ -5,17 +5,18 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.partform_wdr import * class PartForm(wxPanel, Security_Mixin): - def __init__(self, parent, id, state, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, + pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state # self.CreatingPart = False # self.EditingPart = False self.temp_part = None @@ -145,7 +146,7 @@ self.clearForm() self.Enable(True) self.CreatingPart = True - self.GetPoc().SetValue(self.State.currentuser) + self.GetPoc().SetValue(state['currentuser']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) Index: PanGalactic/pangalactic/enterprise/person.py diff -u PanGalactic/pangalactic/enterprise/person.py:1.23 PanGalactic/pangalactic/enterprise/person.py:1.24 --- PanGalactic/pangalactic/enterprise/person.py:1.23 Wed Aug 11 02:21:09 2004 +++ PanGalactic/pangalactic/enterprise/person.py Fri Aug 13 02:43:22 2004 @@ -1,4 +1,4 @@ -# $Id: person.py,v 1.23 2004/08/11 06:21:09 waterbug Exp $ +# $Id: person.py,v 1.24 2004/08/13 06:43:22 waterbug Exp $ """ A human being. @@ -128,7 +128,6 @@ def __init__(self, **kw): PgefObject.__init__(self, **kw) self._password = kw.get('_password', '') - self._loggedin = kw.get('_loggedin', False) self._pending_operations = kw.get('_pending_operations', []) self._authorization = kw.get('_authorization', None) Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.6 PanGalactic/pangalactic/client/modules/psm/docform.py:1.7 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.6 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Fri Aug 13 02:43:20 2004 @@ -3,24 +3,21 @@ from wxPython.wx import * from pangalactic.client.modules.psm.docform_wdr import * - from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions class DocForm(wxPanel, Security_Mixin): - def __init__(self, parent, id, state, delmode = True, debug = 0, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, delmode=True, debug=0, + pos=wxPyDefaultPosition, size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state - self.NextDocId = prefs.get("nextdocid", 0) prefs["nextdocid"] = self.NextDocId - DocFunc(self, True) - if delmode: self.DeleteMode = True button = self.GetDelWgt() @@ -213,21 +210,21 @@ self.ClearForm() self.Enable(True) ctrl = self.GetAuthorWgt() - ctrl.SetValue(self.State.currentuser) + ctrl.SetValue(state['currentuser']) ctrl = self.GetVersionWgt() ctrl.SetValue("1") wgt = self.GetIdentifierWgt() self.NextDocId = str(int(self.NextDocId) + 1) - if self.State.currentprojectname == None: + if not state['currentprojectname']: wgt.SetValue("DOC-" + self.NextDocId) else: - wgt.SetValue(self.State.currentprojectname + "-DOC-" + self.NextDocId) + wgt.SetValue(''.join([state['currentprojectname'], + "-DOC-", + self.NextDocId])) prefs["nextdocid"] = self.NextDocId writePrefs() - self.EditingMode() - wgt = self.GetBrowseWgt() wgt.SetFocus() Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.37 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.38 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.37 Thu Aug 12 17:25:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Fri Aug 13 02:43:20 2004 @@ -3,21 +3,18 @@ import copy from wxPython.wx import * -import pangalactic.enterprise.partslist as partslist - +from pangalactic.utils import objectstatus +from pangalactic.utils import toolframe from pangalactic.utils.securitymanager import actions as security_actions -from pangalactic.utils.pgefexceptions import RequiredDataError -from pangalactic.utils import objectstatus -from pangalactic.utils.preferences import prefs -import pangalactic.utils.toolframe as toolframe - -from pangalactic.client.modules.psm import partslistview -import pangalactic.client.modules.psm.partslistform as partslistform -import pangalactic.client.modules.psm.pgefdoctree as pgefdoctree -import pangalactic.client.modules.psm.doctreeframe as doctreeframe - -import pangalactic.client.dataobjects.partslistinfo as partslistinfo -import pangalactic.client.dataobjects.partslistmap as partslistmap +from pangalactic.utils.pgefexceptions import RequiredDataError +from pangalactic.utils.pgefstate import state +from pangalactic.utils.preferences import prefs +from pangalactic.client.modules.psm import partslistview +from pangalactic.client.modules.psm import partslistform +from pangalactic.client.modules.psm import pgefdoctree +from pangalactic.client.modules.psm import doctreeframe +from pangalactic.client.dataobjects import partslistinfo +from pangalactic.client.dataobjects import partslistmap try: @@ -25,12 +22,12 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.37 $"[11:-2] +__version__ = "$Revision: 1.38 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): - def __init__(self, parent, state, datamanager): + def __init__(self, parent, datamanager): doctreeframe.DocTreeFrame.__init__(self, parent, state, datamanager) self.doctype = self.PARTS_LIST @@ -196,7 +193,6 @@ def OnPartsListView(self, event): print "partslisttreeframe.onpartslistview" self.nb.SetSelection(1) - self.partslistview._loggedin = self.dm.user._loggedin self.partslistview.GetData(self.State.workingdir, self.currentdocument, self.dm.user, @@ -215,7 +211,7 @@ self.ImportPartsListFrame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") self.ImportPartsListFrame.SetDataManager(self.dm) - if self.dm.user._loggedin: + if state['mode'] != 'local': self.ImportPartsListFrame.sb.SetServer( ''.join([self.dm.serverHost, ':', Index: PanGalactic/pangalactic/client/modules/psm/propertiesform.py diff -u PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.17 PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.18 --- PanGalactic/pangalactic/client/modules/psm/propertiesform.py:1.17 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/propertiesform.py Fri Aug 13 02:43:20 2004 @@ -6,6 +6,7 @@ from pangalactic.client.modules.psm.propertiesform_wdr import * from pangalactic.client.support import httpdownload +from pangalactic.utils.pgefstate import state class PropertiesForm(wxPanel): @@ -13,7 +14,6 @@ size=wxPyDefaultSize, style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self._loggedin = False self.propertiesgrid = wxGrid(self, ID_FOREIGN_PROPERTIES) self.propertiesgrid.CreateGrid(25, 4) @@ -66,7 +66,7 @@ print "download file exists" pass else: - if self._loggedin: + if state['loggedin']: # print "logged in" # print tmpdir, component.pgpdm_oid, \ # user.identification, host, port Index: PanGalactic/pangalactic/client/modules/plm/epimsmapping.py diff -u PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.12 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.13 --- PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.12 Thu Aug 12 17:25:16 2004 +++ PanGalactic/pangalactic/client/modules/plm/epimsmapping.py Fri Aug 13 02:43:20 2004 @@ -3,7 +3,8 @@ from epimsgrid import * -import pangalactic.utils.toolframe as toolframe +from pangalactic.utils import toolframe +from pangalactic.utils.pgefstate import state MAPGRID_FOREIGN = wxNewId() DELETEMAPROW = wxNewId() @@ -50,7 +51,7 @@ self.NextRow = 0 self.SelectedRow = None - if self.dm.user._loggedin: + if state['loggedin']: self.sb.SetServer(''.join([self.dm.serverHost, ':', self.dm.serverPort]) Index: PanGalactic/pangalactic/client/modules/psm/pgefedittree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.44 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.45 --- PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.44 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefedittree.py Fri Aug 13 02:43:20 2004 @@ -1,6 +1,7 @@ from wxPython.wx import wxTreeCtrl, wxTreeItemIcon_Selected -import pgeftree -import pangalactic.utils.objectstatus as objectstatus +from pangalactic.client.modules.psm import pgeftree +from pangalactic.utils import objectstatus +from pangalactic.utils.pgefstate import state class PgefEditTree(pgeftree.PgefTree): """Specialized tree for modifying single level of parent-children.""" @@ -39,7 +40,7 @@ if rootitem.has_parts_lists_flag: self.SetItemHasChildren(rootnode, True) - if datamanager.user._loggedin: + if state['loggedin']: if not self.IsExpanded(rootnode): links_objs = datamanager.getPartDocLinksByPartId([rootitemid]) Index: PanGalactic/pangalactic/client/fnord.py diff -u PanGalactic/pangalactic/client/fnord.py:1.114 PanGalactic/pangalactic/client/fnord.py:1.115 --- PanGalactic/pangalactic/client/fnord.py:1.114 Thu Aug 12 17:25:15 2004 +++ PanGalactic/pangalactic/client/fnord.py Fri Aug 13 02:43:19 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: fnord.py,v 1.114 2004/08/12 21:25:15 waterbug Exp $ +# $Id: fnord.py,v 1.115 2004/08/13 06:43:19 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.114 $ +@version: $Revision: 1.115 $ """ -__version__ = "$Revision: 1.114 $"[11:-2] +__version__ = "$Revision: 1.115 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -183,7 +183,7 @@ readState() readPrefs() state['workingdir'] = workingdir - state['mode'] = 'local' + state['loggedin'] = '' self.secure = 1 self.WorkInProgress = False self.SearchFrame = None @@ -307,7 +307,7 @@ self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=state['currentprojectname']) - state['mode'] = 'remote' + state['loggedin'] = '1' self.ActivateTool() self.OnServerCombo() show_tooltips = prefs.get("ShowToolTips", False) @@ -449,13 +449,13 @@ print "fnord.OnServerCombo, state =", state print " - prefs =", prefs print " - state =", state - if state['mode'] == 'local': + if not state['loggedin']: print "in local mode" + self.menuBar.Enable(ID_FILE_LOGIN, True) self.psmtool.SetupForLocalMode() self.sb.ShowImage(False) else: print "in non-local mode" - self.menuBar.Enable(ID_FILE_LOGIN, True) self.psmtool.SetupForLogin() self.sb.ShowImage(True) @@ -802,7 +802,7 @@ def OnGetMyStuff(self, event=None): - if self.dm.user._loggedin: + if state['loggedin']: if not self.SearchFrame: self.SearchFrame = searchframe.SearchFrame(self, -1, @@ -907,26 +907,26 @@ self.menuBar.Refresh() def OnLogout(self, event): - self.menuBar.Enable(ID_FILE_LOGIN, not self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_PROXY, not self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_SERVER1, not self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_SERVER2, not self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_USERID, not self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, not self.dm.user._loggedin) - - self.menuBar.Enable(ID_FILE_LOGOUT, self.dm.user._loggedin) - self.menuBar.Enable(ID_FILE_COMMIT,self.dm.user._loggedin) - self.menuBar.Enable(ID_PREF_PASSWD, self.dm.user._loggedin) - self.menuBar.Enable(ID_TOOL_GETMYSTUFF, self.dm.user._loggedin) - self.menuBar.Enable(ID_TOOL_SEARCH, self.dm.user._loggedin) - - state['mode'] = 'local' + self.menuBar.Enable(ID_FILE_LOGIN, 1) + self.menuBar.Enable(ID_PREF_PROXY, 1) + self.menuBar.Enable(ID_PREF_SERVER1, 1) + self.menuBar.Enable(ID_PREF_SERVER2, 1) + self.menuBar.Enable(ID_PREF_USERID, 1) + self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) + + self.menuBar.Enable(ID_FILE_LOGOUT, 0) + self.menuBar.Enable(ID_FILE_COMMIT, 0) + self.menuBar.Enable(ID_PREF_PASSWD, 0) + self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 0) + self.menuBar.Enable(ID_TOOL_SEARCH, 0) + state['loggedin'] = '' self.sb.SetServer('Local') self.OnServerCombo() def OnLogin(self, event): print "fnord.OnLogin" + state['loggedin'] = '1' loginconfirm = prefs.get('ShowLoginConfirmed', None) dialog = LoginClass(self, -1, "PGEF Login" ) if loginconfirm == None: @@ -981,20 +981,19 @@ self.dm.getProjects() self.removeSpecialMenus(self.dm.user) - loggedin = self.dm.user._loggedin - self.menuBar.Enable(ID_PREF_PROXY, not loggedin) - self.menuBar.Enable(ID_PREF_SERVER1, not loggedin) - self.menuBar.Enable(ID_PREF_SERVER2, not loggedin) - self.menuBar.Enable(ID_PREF_USERID, not loggedin) - self.menuBar.Enable(ID_FILE_LOGIN, not loggedin) - - self.menuBar.Enable(ID_FILE_LOGOUT, loggedin) - self.menuBar.Enable(ID_FILE_COMMIT, loggedin) - self.menuBar.Enable(ID_TOOL_GETMYSTUFF, loggedin) - self.menuBar.Enable(ID_TOOL_SEARCH, loggedin) - self.menuBar.Enable(ID_PREF_PASSWD, loggedin) - self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, loggedin) + self.menuBar.Enable(ID_PREF_PROXY, 0) + self.menuBar.Enable(ID_PREF_SERVER1, 0) + self.menuBar.Enable(ID_PREF_SERVER2, 0) + self.menuBar.Enable(ID_PREF_USERID, 0) + self.menuBar.Enable(ID_FILE_LOGIN, 0) + + self.menuBar.Enable(ID_FILE_LOGOUT, 1) + self.menuBar.Enable(ID_FILE_COMMIT, 1) + self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 1) + self.menuBar.Enable(ID_TOOL_SEARCH, 1) + self.menuBar.Enable(ID_PREF_PASSWD, 1) + self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) self.sb.SetServer(''.join(['Repository: ', self.dm.serverHost, Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.38 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.39 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.38 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Fri Aug 13 02:43:20 2004 @@ -17,17 +17,18 @@ from pangalactic.utils import objectstatus from pangalactic.utils.preferences import prefs -__version__ = "$Revision: 1.38 $"[11:-2] +__version__ = "$Revision: 1.39 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): - def __init__(self, parent, state, datamanager): - doctreeframe.DocTreeFrame.__init__(self, parent, state, datamanager) + def __init__(self, parent, datamanager): + doctreeframe.DocTreeFrame.__init__(self, parent, datamanager) self.doctype = self.DOCUMENT - self.tree.SetToolTip(wxToolTip("A list of Documents. Click on a Document to display its data.")) - self.docform = docform.DocForm(self.nb, -1, state, delmode = False) + self.tree.SetToolTip(wxToolTip( + "A list of Documents. Click on a Document to display its data.")) + self.docform = docform.DocForm(self.nb, -1, delmode = False) self.nb.AddPage(self.docform, "Meta Data") self.nb.AddPage(self.grid, "Meta Data Table") @@ -44,7 +45,7 @@ self.SetupTree() print "before setup" self.Setup() - + def Setup(self): self.currentdocument = self.dm.newObject("Document") @@ -58,7 +59,7 @@ self.docform.FillForm(self.currentdocument) self.docform.BrowseMode(True) - + def OnNewDoc(self, event): # print "new doc" @@ -80,12 +81,14 @@ self.dm.refresh = True except RequiredDataError, e: - dlg = wxMessageDialog(self, e.value, "Required Document Data Missing.", + dlg = wxMessageDialog(self, + e.value, + "Required Document Data Missing.", wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy() self.docform.EditingMode() - + def SaveDoc(self, document_id): print "savedoc" if self.creatingDocument: @@ -98,28 +101,12 @@ except: self.docform.EditingMode() return - -# dfile = self.dm.newObject("PgefFile") -# dfile.parent = newdoc.pgef_oid -# dfile.setLocalFilename(newdoc._upload_file_name) -# dfile.mime_type_oid = "text/plain" - dfile = self.dm.newPgefFile(newdoc) #, newdoc._upload_file_name) + dfile = self.dm.newPgefFile(newdoc) dfile.state = objectstatus.ADD self.dm.save([newdoc, dfile]) - self.dm.addProjectObjects(self.State.currentprojectname, [newdoc, dfile]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[newdoc.pgef_oid] = newdoc.__class__.__name__ -# projlist[dfile.pgef_oid] = dfile.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist - + self.dm.addProjectObjects(self.State.currentprojectname, + [newdoc, dfile]) if self.EditMode: self.EditMode = False self.currentdocument(**newdoc.__dict__) @@ -144,17 +131,22 @@ if node == rootnode: # print "have root node" - treeid = self.tree.AppendItem(node, self.currentdocument.id) - self.tree.SetPyData(treeid, ["TOPLEVEL", self.currentdocument.pgef_oid]) - self.tree.SetItemImage(treeid, self.tree.documenticon) - self.tree.SetItemImage(treeid, self.tree.documenticon, wxTreeItemIcon_Selected) + treeid = self.tree.AppendItem(node, + self.currentdocument.id) + self.tree.SetPyData(treeid, + ["TOPLEVEL", self.currentdocument.pgef_oid]) + self.tree.SetItemImage(treeid, + self.tree.documenticon) + self.tree.SetItemImage(treeid, + self.tree.documenticon, + wxTreeItemIcon_Selected) if not self.tree.IsExpanded(rootnode): self.tree.Expand(rootnode) self.docform.BrowseMode(True) else: self.docform.BrowseMode(False) # print "end onlinkdoc" - + def OnClose(self, event = None): if self.dm.uncommittedData(): @@ -165,7 +157,7 @@ wxYES_NO | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_YES: retval = self.SaveChanges() - + if not retval: # problem occurred while saving changes... # print "didn't save changes?" @@ -182,15 +174,18 @@ print "documenttreeframe.buildtree" treedlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(400, 75), wxTHICK_FRAME) - msg = wxStaticText(treedlg, -1, "Please wait while PGEF accesses the Document data...", - wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) + msg = wxStaticText(treedlg, -1, + "Please wait while PGEF accesses the Document data...", + wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) treedlg.CentreOnParent() treedlg.Show(True) self.docform.ClearForm() if not self.tree: - self.tree = pgefdoctree.PgefDocTree(self.vsplitter, self.tID, self.dm) - self.tree.SetToolTip(wxToolTip("A hierarchical display of the currently selected document.")) + self.tree = pgefdoctree.PgefDocTree(self.vsplitter, + self.tID, self.dm) + self.tree.SetToolTip(wxToolTip( + "A hierarchical display of the currently selected document.")) self.ReplaceTree(self.tree) self.currenttree = "OTHERDOC" @@ -214,7 +209,7 @@ else: retval = True return retval - + def DiscardChanges(self): if self.creatingDocument: docid = prefs.get('nextdocid', 0) @@ -226,7 +221,9 @@ def SaveDocChanges(self): - """Save all changes to any open Document windows and close them all.""" + """ + Save all changes to any open Document windows and close them all. + """ if self.creatingDocument: doc = self.dm.newObject("Document") @@ -243,7 +240,8 @@ try: doc.validate() except RequiredDataError, e: - dlg = wxMessageDialog(self, e.value, "Required Document Data Missing.", + dlg = wxMessageDialog(self, e.value, + "Required Document Data Missing.", wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy() @@ -265,4 +263,4 @@ if docretval: return True return False - + Index: PanGalactic/pangalactic/client/modules/psm/partslistview.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.18 PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.19 --- PanGalactic/pangalactic/client/modules/psm/partslistview.py:1.18 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistview.py Fri Aug 13 02:43:20 2004 @@ -15,18 +15,25 @@ class PartsListView(wxPanel): - def __init__(self, parent, id, pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, + pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent #self.dm = None - self._loggedin = False - self.EpimsNames = ["Part ID", "Project Name Code", "Spec", "Generic", "MFR", "NSN", "CAGE Code", "Name Code", "FSC Code", "Description", "Package Type", "Specification", "Screening Specification", "Failure Rate Level", "NASA NSPAR Number", "Lot Date Code", "Quantity", "Serial Number"] + self.EpimsNames = ["Part ID", "Project Name Code", "Spec", + "Generic", "MFR", "NSN", "CAGE Code", "Name Code", "FSC Code", + "Description", "Package Type", "Specification", + "Screening Specification", "Failure Rate Level", + "NASA NSPAR Number", "Lot Date Code", "Quantity", + "Serial Number"] self.partslistgrid = wxGrid(self, ID_FOREIGN_PARTSLISTVIEW) self.partslistgrid.CreateGrid(500, 17) - self.partslistgrid.GetGridWindow().SetToolTip(wxToolTip("A tabular display of the Parts List data.")) + self.partslistgrid.GetGridWindow().SetToolTip( + wxToolTip("A tabular display of the Parts List data.")) self.partslistgrid.SetMargins(0, 0) self.partslistgrid.SetRowLabelSize(0) @@ -53,14 +60,13 @@ pass #print "header file exists" else: - if self._loggedin: - #retval not used.. so commented it out - #retval = httpdownload.DownloadFile(tmpdir, self.schemafilename, user, host, port, "dictionary") - httpdownload.DownloadFile(tmpdir, self.schemafilename, user, host, port, "dictionary") + if state['loggedin']: + httpdownload.DownloadFile(tmpdir, self.schemafilename, + user, host, port, + "dictionary") else: #print "Parts Lists are not available in local mode" return - headerfile = open(self.headerfilename) headerrow = headerfile.readline() headerrow = headerrow.strip() @@ -73,8 +79,10 @@ self.ncols = 0 self.partslist = pl - dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(400, 75), wxTHICK_FRAME) - msg = wxStaticText(dlg, -1, "Please wait while PGEF retrieves the data...", + dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, + wxSize(400, 75), wxTHICK_FRAME) + msg = wxStaticText(dlg, -1, + "Please wait while PGEF retrieves the data...", wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) @@ -96,10 +104,10 @@ #print "download file exists" else: # print "self.LoggedIn: " + str(self.LoggedIn) - if self._loggedin: - #retval not sued.. so commented out - #retval = httpdownload.DownloadFile(tmpdir, pl._upload_file_name, user, host, port, "parts_list") - httpdownload.DownloadFile(tmpdir, pl._upload_file_name, user, host, port, "parts_list") + if state['loggedin']: + httpdownload.DownloadFile(tmpdir, + pl._upload_file_name, user, host, port, + "parts_list") else: #print "Parts Lists are not available in local mode" dlg.Destroy() @@ -142,10 +150,14 @@ ncols = len(datacells) if ncols > maxcol: for col in range(maxcol): - self.partslistgrid.SetCellValue(self.nrows, col, datacells[col]) + self.partslistgrid.SetCellValue(self.nrows, + col, + datacells[col]) else: for col in range(ncols): - self.partslistgrid.SetCellValue(self.nrows, col, datacells[col]) + self.partslistgrid.SetCellValue(self.nrows, + col, + datacells[col]) self.nrows += 1 if self.nrows >= self.partslistgrid.GetNumberRows(): @@ -183,7 +195,8 @@ self.partslistgrid.BeginBatch() for row in range(self.nrows): for col in range(self.ncols): - self.partslistgrid.SetCellValue(row, col, "(" + str(row) + "," + str(col) + ")") + self.partslistgrid.SetCellValue(row, col, + "(" + str(row) + "," + str(col) + ")") self.partslistgrid.EndBatch() Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.174 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.175 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.174 Thu Aug 12 17:25:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Fri Aug 13 02:43:20 2004 @@ -9,7 +9,7 @@ This module is the main application code for the pgef client interface """ -__version__ = "$Revision: 1.174 $"[11:-2] +__version__ = "$Revision: 1.175 $"[11:-2] import os @@ -58,8 +58,8 @@ #from pangalactic.client.modules.psm import pgefgrid from pangalactic.utils import basegrid from pangalactic.client.modules.psm import doctreeframe -from pangalactic.client.modules.psm import documenttreeframe -from pangalactic.client.modules.psm import partslisttreeframe +from pangalactic.client.modules.psm.documenttreeframe import DocumentTreeFrame +from pangalactic.client.modules.psm.partslisttreeframe import PartsListTreeFrame try: # this imports are for ExportProperties @@ -105,25 +105,22 @@ def __init__(self, parent, datamgr, ID, pos, size): wxPanel.__init__(self, parent, ID, pos, size) - self.Parent = parent self.dm = datamgr - self.itemeditform = None self.SearchFrame = None self.projectframe = None - self.RefreshGrid = False self.ExpandingNode = False self.acroreaderids = [] self.ToolMenu = None self.ClosingDocTool = False - self.SetSize (self.Parent.GetClientSize()) - # will occupy the space not used by the Layout Algorithm - self.grid_notebook = wxNotebook(self, -1, wxDefaultPosition, wxSize(200, 200)) - + self.grid_notebook = wxNotebook(self, + -1, + wxDefaultPosition, + wxSize(200, 200)) #Create grid to hold Models # self.modelgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, # classname = "Model", @@ -132,16 +129,17 @@ classname = "Model", localdb = self.dm.localDB) grid_tooltip = "A tabular display of the data in the models " + \ - "of the currently selected project.\n" + \ - "Doubleclick on a part to display the Model Editor.\n" + \ - "Press to drag a Model into the hierarchy." + "of the currently selected project.\n" + \ + "Doubleclick on a part to display the Model Editor.\n" + \ + "Press to drag a Model into the hierarchy." self.modelgrid.GetGridWindow().SetToolTip(wxToolTip(grid_tooltip)) self.modelgrid.EnableEditing(False) - self.modelgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, "Edit...")] + self.modelgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, + "Edit...")] self.grid_notebook.AddPage(self.modelgrid, "Models") - self.modelgrid.Fit() # remove funny blank space in the first row of the grid, - # if it initially has a scrollbar - + # remove funny blank space in the first row of the grid, if it + # initially has a scrollbar + self.modelgrid.Fit() # Create Grid to hold Parts # self.itemgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, # classname = "Part", @@ -150,16 +148,17 @@ classname = "Part", localdb = self.dm.localDB) grid_tooltip = "A tabular display of the data in the parts " + \ - "of the currently selected project.\n" + \ - "Doubleclick on a part to display the Part Editor.\n" + \ - "Press to drag a Part into the hierarchy." + "of the currently selected project.\n" + \ + "Doubleclick on a part to display the Part Editor.\n" + \ + "Press to drag a Part into the hierarchy." self.itemgrid.GetGridWindow().SetToolTip(wxToolTip(grid_tooltip)) self.itemgrid.EnableEditing(False) - self.itemgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, "Edit...")] + self.itemgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, + "Edit...")] self.grid_notebook.AddPage(self.itemgrid, "Parts") - self.itemgrid.Fit() # remove funny blank space in the first row of the grid, - # if it initially has a scrollbar - + # remove funny blank space in the first row of the grid, if it + # initially has a scrollbar + self.itemgrid.Fit() # create the splitter window that holds the shell window, # if pycrust imported successfully if HAVE_SHELL: @@ -174,11 +173,13 @@ "You're on your own." win.SetToolTip(wxToolTip(grid_tooltip)) self.grid_notebook.AddPage(win, "PyCrust") - # Create some layout windows # A window like a toolbar - win = wxSashLayoutWindow(self, self.ID_WINDOW_TOP, - wxDefaultPosition, wxSize(800, 40), wxSW_BORDER|wxNO_BORDER) + win = wxSashLayoutWindow(self, + self.ID_WINDOW_TOP, + wxDefaultPosition, + wxSize(800, 40), + wxSW_BORDER|wxNO_BORDER) win.SetOrientation(wxLAYOUT_HORIZONTAL) win.SetAlignment(wxLAYOUT_TOP) win.SetSashVisible(wxSASH_BOTTOM, True) @@ -187,110 +188,130 @@ win.SetMinimumSizeY(35) win.SetMaximumSizeY(35) self.topWindow = win - # A window to the left of the client window to hold our tree - win = wxSashLayoutWindow(self, self.ID_WINDOW_LEFT, - wxDefaultPosition, wxSize(200, 30), wxNO_BORDER|wxSW_3D) + win = wxSashLayoutWindow(self, + self.ID_WINDOW_LEFT, + wxDefaultPosition, + wxSize(200, 30), + wxNO_BORDER|wxSW_3D) win.SetDefaultSize(wxSize(220, 600)) win.SetOrientation(wxLAYOUT_VERTICAL) win.SetAlignment(wxLAYOUT_LEFT) win.SetSashVisible(wxSASH_RIGHT, True) - self.leftPanel = wxPanel(win, ID_LEFT_PANEL) hbox = wxBoxSizer(wxVERTICAL) - choice_list = ["Default", "Requirements", "Functions", "Simulations"] - self.view = wxChoice(self.leftPanel, ID_CHOICE_VIEW, wxPoint(90, 50), wxSize(95, -1), choice_list) + self.view = wxChoice(self.leftPanel, + ID_CHOICE_VIEW, + wxPoint(90, 50), + wxSize(95, -1), + choice_list) hbox.Add(self.view, 0, wxEXPAND) - - self.tree_notebook = wxNotebook(self.leftPanel, -1, wxDefaultPosition, wxSize(200, 200)) - + self.tree_notebook = wxNotebook(self.leftPanel, + -1, + wxDefaultPosition, + wxSize(200, 200)) self.tID = wxNewId() self.treeMap = {} - self.tree = pgefmaintree.PgefMainTree(self.tree_notebook, self.tID, self.dm) + self.tree = pgefmaintree.PgefMainTree(self.tree_notebook, + self.tID, + self.dm) self.tree.SetBackgroundColour(wxWHITE) tree_tooltip = "A hierarchy of the currently selected part.\n" + \ - "Click on a part to highlight its data in the Parts grid.\n" + \ - "Doubleclick on a part to display the Part Editor." + "Click on a part to highlight its data in the Parts grid.\n" + \ + "Doubleclick on a part to display the Part Editor." self.tree.SetToolTip(wxToolTip(tree_tooltip)) self.tree_notebook.AddPage(self.tree, 'Assembly') - self.version_tree_ID = wxNewId() self.version_tree = pgefversiontree.PgefVersionTree(self.tree_notebook, - self.version_tree_ID, - self.dm) + self.version_tree_ID, + self.dm) tree_tooltip = "A hierarchy of the currently selected part.\n" + \ - "Click on a part to highlight its data in the Parts grid.\n" + \ - "Doubleclick on a part to display the Part Editor." + "Click on a part to highlight its data in the Parts grid.\n" + \ + "Doubleclick on a part to display the Part Editor." self.version_tree.SetToolTip(wxToolTip(tree_tooltip)) - self.tree_notebook.AddPage(self.version_tree, 'Version') - hbox.Add(self.tree_notebook, 1, wxEXPAND) self.leftPanel.SetSizer(hbox) hbox.Fit(self.leftPanel) - self.leftWindow = win - wxLayoutAlgorithm().LayoutWindow(self, self.grid_notebook) self.Layout() - # workaround to allow for the toolbar height in determining # mouseclick locations in the grid. # e.g., rightclick popup menus toolbarsize = self.topWindow.toppanel.GetSizeTuple() self.itemgrid.setVerticalOffset(toolbarsize[1]) self.modelgrid.setVerticalOffset(toolbarsize[1]) - self.itemlistcount = None self.UpdateForLogin() - self.topWindow.toppanel.GetProjectWidget().SetSelection(0) self.topWindow.toppanel.GetItemWidget().SetSelection(0) - self.DisplayWgts = [] self.DisplayWgts.append((self.itemgrid, "GRID", 'Part')) self.DisplayWgts.append((self.modelgrid, "GRID", 'Model')) - self.DisplayWgts.append((self.topWindow.toppanel, "SEQUENCE")) # only access the itemwidget in this class - + # only access the itemwidget in this class + self.DisplayWgts.append((self.topWindow.toppanel, "SEQUENCE")) #Event bindings EVT_SIZE(self, self.OnSize) - EVT_SASH_DRAGGED(self, self.ID_WINDOW_LEFT, self.OnSashDrag) - - EVT_MENU(self.Parent, ID_FILE_CLOSE, self.Parent.CloseActiveTool) - EVT_MENU(self.Parent, ID_PSM_SEARCH_ITEMS, self.OnSearchItems) - EVT_MENU(self, ID_TREE_RIGHTPOPUP_EDIT, self.OnEditComponent) - EVT_MENU(self, ID_TREE_RIGHTPOPUP_SHOWPROJECT, self.OnShowProjectFrame) - EVT_MENU(self, ID_TREE_RIGHTPOPUP_DUMPTOPDF, self.tree.DumpToPdf) - - EVT_CHOICE(self, toolbarpanel.ID_PROJECT, self.OnSelectProject) - EVT_CHOICE(self, toolbarpanel.ID_ITEM, self.OnItemClick) + EVT_SASH_DRAGGED(self, + self.ID_WINDOW_LEFT, + self.OnSashDrag) + EVT_MENU(self.Parent, + ID_FILE_CLOSE, + self.Parent.CloseActiveTool) + EVT_MENU(self.Parent, + ID_PSM_SEARCH_ITEMS, + self.OnSearchItems) + EVT_MENU(self, + ID_TREE_RIGHTPOPUP_EDIT, + self.OnEditComponent) + EVT_MENU(self, + ID_TREE_RIGHTPOPUP_SHOWPROJECT, + self.OnShowProjectFrame) + EVT_MENU(self, + ID_TREE_RIGHTPOPUP_DUMPTOPDF, + self.tree.DumpToPdf) + EVT_CHOICE(self, + toolbarpanel.ID_PROJECT, + self.OnSelectProject) + EVT_CHOICE(self, + toolbarpanel.ID_ITEM, + self.OnItemClick) EVT_GRID_CELL_LEFT_DCLICK(self.itemgrid, self.onGridDClick) EVT_GRID_CELL_LEFT_DCLICK(self.modelgrid, self.onGridDClick) - #EVT_GRID_CELL_LEFT_CLICK(self.itemgrid, self.onGridClickGetVersions) #EVT_GRID_CELL_LEFT_CLICK(self.modelgrid, self.onGridClick) - EVT_GRID_LABEL_LEFT_CLICK(self.itemgrid, self.onGridClickGetVersions) EVT_GRID_LABEL_LEFT_CLICK(self.modelgrid, self.onGridClick) - - EVT_MENU(self.itemgrid, basegrid.ID_POPUP_EDIT, self.onGridPopupEdit) - EVT_MENU(self.modelgrid, basegrid.ID_POPUP_EDIT, self.onGridPopupEdit) - - EVT_RIGHT_DOWN(self.tree, self.OnRightDown) - EVT_TREE_ITEM_EXPANDING(self, self.tID, self.OnItemExpanding) - EVT_TREE_SEL_CHANGED(self, self.tID, self.OnTreeActivate) - - EVT_LEFT_DCLICK(self.tree, self.OnEditComponent) - EVT_LEFT_DCLICK(self.version_tree, self.OnEditComponent) - - EVT_CHOICE(self, ID_CHOICE_VIEW, self.SelectView) - - EVT_NOTEBOOK_PAGE_CHANGED(self, self.grid_notebook.GetId(), self.pageChanged) + EVT_MENU(self.itemgrid, + basegrid.ID_POPUP_EDIT, + self.onGridPopupEdit) + EVT_MENU(self.modelgrid, + basegrid.ID_POPUP_EDIT, + self.onGridPopupEdit) + EVT_RIGHT_DOWN(self.tree, + self.OnRightDown) + EVT_TREE_ITEM_EXPANDING(self, + self.tID, + self.OnItemExpanding) + EVT_TREE_SEL_CHANGED(self, + self.tID, + self.OnTreeActivate) + EVT_LEFT_DCLICK(self.tree, + self.OnEditComponent) + EVT_LEFT_DCLICK(self.version_tree, + self.OnEditComponent) + EVT_CHOICE(self, + ID_CHOICE_VIEW, + self.SelectView) + EVT_NOTEBOOK_PAGE_CHANGED(self, + self.grid_notebook.GetId(), + self.pageChanged) def synchGridSelections(self, obj): - #print "psmtool.synchGridSelections" + # print "psmtool.synchGridSelections" objclass = obj.__class__.__name__ if objclass == "Part": @@ -309,7 +330,7 @@ self.itemgrid.SelectRow(row) def onGridClick(self, event): - #print "psmtool.ongridclick" + # print "psmtool.ongridclick" ndx = event.GetRow() grid = event.GetEventObject() obj = grid.getObject(ndx) @@ -318,7 +339,7 @@ def onGridClickGetVersions(self, event): - #print "psmtool.ongridclickgetversions" + # print "psmtool.ongridclickgetversions" ndx = event.GetRow() grid = event.GetEventObject() obj = grid.getObject(ndx) @@ -332,7 +353,7 @@ def pageChanged(self, event): - #print "psmtool.pagechanged" + # print "psmtool.pagechanged" gridpage = self.grid_notebook.GetSelection() grid = self.GetCurrentGrid() @@ -347,7 +368,7 @@ def GetCurrentGrid(self, currentpage = None): - #print "psmtool.getcurrentgrid", currentpage + # print "psmtool.getcurrentgrid", currentpage currentgrid = None if currentpage == None: currentpage = self.grid_notebook.GetSelection() @@ -362,20 +383,19 @@ def ExportProperties(self): - #print "psmtool.exportproperties" + # print "psmtool.exportproperties" if not CAN_EXPORT_PROPERTIES: print "Export to MS Excel is not available." return - currentgrid = self.GetCurrentGrid() nrows = currentgrid.GetNumberRows() # sometimes the grid has one empty row if nrows == 0: - dlg = wxMessageDialog(self, "There is no point generating an Excel file. The grid is empty.", - "A message from PGEF", wxOK | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "There is no point generating an Excel file. The grid is empty.", + "A message from PGEF", wxOK | wxICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return - #import partslistview temp = partslistview.PartsListView(self, -1) temp.Show(False) @@ -390,7 +410,6 @@ else: temp.Destroy() return - fdlg = wxFileDialog(self, "Choose a file", fullpath, ''.join([state['currentprojectname'], '_properties', '.xls']), @@ -402,7 +421,6 @@ else: fdlg.Destroy() return - files = [] for row in range(nrows): pid = currentgrid.GetObjectOid(row) @@ -418,7 +436,6 @@ os.path.join(state['workingdir'], 'tmp', (pid + '.properties'))]) - if len(files) > 0: try: #from modules.plm.ms2file import Data2MS @@ -430,7 +447,6 @@ cdlg = wxMessageDialog(self, "Export Complete", "", wxOK) cdlg.ShowModal() cdlg.Destroy() - except: edlg = wxMessageDialog(self, "Excel... What's that?", @@ -454,7 +470,6 @@ node, flags = tree.HitTest(point) if node.IsOk(): tree.SelectItem(node) - # popup help seems to be ignored.... grrrr menu = wxMenu() menu.Append(ID_TREE_RIGHTPOPUP_EDIT, @@ -467,9 +482,9 @@ "Edit this Part") menu.SetHelpString(ID_TREE_RIGHTPOPUP_SHOWPROJECT, "View Project Data") - self.PopupMenuXY(menu, event.GetX(), event.GetY()) + def SecureMenu(self): project = self.topWindow.toppanel.GetProjectWidget( ).GetStringSelection() @@ -501,7 +516,7 @@ def RebuildMainTree(self): - #print "psmtool.rebuildmaintree" + # print "psmtool.rebuildmaintree" projectndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() if projectndx > 0: itemndx = self.topWindow.toppanel.GetItemWidget().GetSelection() @@ -531,11 +546,12 @@ self.projectframe.Show(False) self.projectframe = None - def ShowEditFrame(self, rootobj, nodedata = None, mode = itemeditframe.BROWSE_MODE): + def ShowEditFrame(self, rootobj, nodedata=None, + mode=itemeditframe.BROWSE_MODE): """ Create/Show the Edit Window. """ - #print "psmtool.showeditframe", rootobj.id, mode + # print "psmtool.showeditframe", rootobj.id, mode if self.itemeditform: self.itemeditform.Setup(rootobj, nodedata, self.DisplayWgts, mode) if not self.itemeditform.IsShown(): @@ -549,7 +565,7 @@ mode) self.itemeditform.Show(True) - if self.dm.user._loggedin: + if state['loggedin']: self.itemeditform.sb.SetServer( ''.join([self.dm.serverHost, ':', @@ -561,18 +577,22 @@ def OnNewPart(self, metadata): obj = self.dm.newObject(metadata[2]) - self.ShowEditFrame(rootobj = obj, nodedata = metadata, mode = itemeditframe.NEW_MODE) + self.ShowEditFrame(rootobj=obj, + nodedata=metadata, + mode=itemeditframe.NEW_MODE) def OnNewModel(self, metadata): - #print "psmtool.onnewmodel" + # print "psmtool.onnewmodel" obj = self.dm.newObject(metadata[2]) - self.ShowEditFrame(rootobj = obj, nodedata = metadata, mode = itemeditframe.NEW_MODE) + self.ShowEditFrame(rootobj=obj, + nodedata=metadata, + mode=itemeditframe.NEW_MODE) def OnNewPartsList(self): - #print "psmtool.onnewparts" - #print "currentproject", state['currentprojectname'] - foo = partslisttreeframe.PartsListTreeFrame(self.Parent, state, self.dm) + # print "psmtool.onnewparts" + # print "currentproject", state['currentprojectname'] + foo = PartsListTreeFrame(self.Parent, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -580,8 +600,8 @@ def OnNewDoc(self): - #print "psmtool.onnewdoc", state['currentprojectname'] - foo = documenttreeframe.DocumentTreeFrame(self.Parent, state, self.dm) + # print "psmtool.onnewdoc", state['currentprojectname'] + foo = DocumentTreeFrame(self.Parent, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -590,11 +610,13 @@ def OnGridToPdf(self, event = None): currentgrid = self.GetCurrentGrid() - nrows = currentgrid.GetNumberRows() # sometimes the grid has one empty row + # sometimes the grid has one empty row + nrows = currentgrid.GetNumberRows() if nrows == 0: - dlg = wxMessageDialog(self, "The grid is empty. There is no point generating a PDF.", - "A message from PGEF", - wxOK | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "The grid is empty. There is no point generating a PDF.", + "A message from PGEF", + wxOK | wxICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return @@ -605,10 +627,13 @@ def OnSearchItems(self, event = None): if not self.SearchFrame: - self.SearchFrame = searchframe.SearchFrame(self, -1, 'Search', datamanager = self.dm) + self.SearchFrame = searchframe.SearchFrame(self, -1, 'Search', + datamanager=self.dm) self.SearchFrame.CentreOnParent() EVT_CLOSE(self.SearchFrame, self.CloseSearchFrame) - EVT_BUTTON(self.SearchFrame, self.SearchFrame.getCloseWgt().GetId(), self.CloseSearchFrame) + EVT_BUTTON(self.SearchFrame, + self.SearchFrame.getCloseWgt().GetId(), + self.CloseSearchFrame) self.SearchFrame.Show(True) def CloseSearchFrame (self, event = None): @@ -617,12 +642,14 @@ self.SearchFrame = None - def Commit(self, closing = False, objectlist = None, dont_ask = False): - """Save any changes made; retrieve the data from the local storage device - and send it to the server.""" + def Commit(self, closing=False, objectlist=None, dont_ask=False): + """ + Save any changes made; retrieve the data from the local storage + device and send it to the server. + """ print "psmtool.commit", len(objectlist) - #print objectlist + # print objectlist retval = [] if self.dm.uncommittedData(): if dont_ask: @@ -688,13 +715,15 @@ savedlg.Destroy() wxEndBusyCursor() if retval: - dlg = wxMessageDialog(self, "The data was successfully committed", - "Commit Results", wxOK | wxICON_INFORMATION) + dlg = wxMessageDialog(self, + "The data was successfully committed", + "Commit Results", wxOK | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() else: - dlg = wxMessageDialog(self, "Hmmmmm... Your data didn't upload.", - "Commit Results", wxOK | wxICON_INFORMATION) + dlg = wxMessageDialog(self, + "Hmmmmm... Your data didn't upload.", + "Commit Results", wxOK | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() @@ -704,8 +733,9 @@ def UpdateForLogin(self): print "psmtool.updateforlogin" - if self.dm.user._loggedin: - self.topWindow.toppanel.FillProjectWidget(self.dm.projects, "Select a Project") + if state['loggedin']: + self.topWindow.toppanel.FillProjectWidget(self.dm.projects, + "Select a Project") wgt = self.topWindow.toppanel.GetItemWidget() wgt.SetSelection(0) self.tree.DeleteAllItems() @@ -716,10 +746,11 @@ def OnItemExpanding(self, event): - #print "psmtool.onitemexpanding" + # print "psmtool.onitemexpanding" cookie = wxNewId() node = event.GetItem() - if self.tree.IsExpanded(node): # This event can happen twice in the self.Expand call + # This event can happen twice in the self.Expand call + if self.tree.IsExpanded(node): return childnode = self.tree.GetFirstChild(node, cookie) @@ -728,15 +759,16 @@ return else: - #print "looking for children" + # print "looking for children" self.dm.setCurrentProject(state['currentprojectname']) treetuple = self.tree.GetPyData(node) obj = self.dm.getLookupObject(treetuple[1]) if not self.inLocalMode(): linkedobjs = self.dm.getNAUOByAssemblyID([obj.pgef_oid]) - linkedobjs = self.dm.getLocalAcusByAssemblyID(obj.pgef_oid, - self.dm.CurrentProject) + linkedobjs = self.dm.getLocalAcusByAssemblyID( + obj.pgef_oid, + self.dm.CurrentProject) if len(linkedobjs) == 0: self.tree.SetItemHasChildren(node, False) return @@ -764,7 +796,7 @@ def CloseDown(self): - if self.dm.user._loggedin: + if state['loggedin']: self.CheckForUncommittedData(True) @@ -786,10 +818,12 @@ eID = event.GetId() if eID == self.ID_WINDOW_TOP: - self.topWindow.SetDefaultSize(wxSize(800, event.GetDragRect().height)) #tbd + self.topWindow.SetDefaultSize( + wxSize(800, event.GetDragRect().height)) #tbd elif eID == self.ID_WINDOW_LEFT: - self.leftWindow.SetDefaultSize(wxSize(event.GetDragRect().width, 600)) #tbd + self.leftWindow.SetDefaultSize( + wxSize(event.GetDragRect().width, 600)) #tbd wxLayoutAlgorithm().LayoutWindow(self, self.grid_notebook) self.grid_notebook.Refresh() @@ -802,7 +836,7 @@ def OnTreeActivate(self, event): - #print "psmtool.ontreeactivate" + # print "psmtool.ontreeactivate" treeobj = self.tree.GetPyData(event.GetItem()) nauoid = treeobj[0] itemid = treeobj[1] @@ -825,28 +859,29 @@ break def CheckForUncommittedData(self, closing = False): - #print "psmtool.CheckForUncommittedData" + # print "psmtool.CheckForUncommittedData" if self.dm.inLocalMode: print "Why check for uncommitted data in local mode???" return #bryan if self.dm.uncommittedData(): - dlg = wxMessageDialog(self, "You have uncommitted changes. Shall I commit them?", - "Warning: Data Loss Imminent", - wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "You have uncommitted changes. Shall I commit them?", + "Warning: Data Loss Imminent", + wxYES_NO | wxYES_DEFAULT | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_YES: self.Commit(closing) def showItem(self, itemobj): - #print "psmtool.showitem", itemobj.id + # print "psmtool.showitem", itemobj.id itemid = itemobj.pgef_oid self.tree.DeleteAllItems() self.version_tree.DeleteAllItems() - if self.dm.user._loggedin: + if state['loggedin']: self.dm.getNAUOByAssemblyID([itemid]) self.tree.LoadTreefromObjects(self.dm, itemobj) @@ -856,23 +891,21 @@ def OnItemClick(self, event = None): - #print "psmtool.onitemclick" + # print "psmtool.onitemclick" ndx = self.topWindow.toppanel.GetItemWidget().GetSelection() if ndx == 0: wgt = self.topWindow.toppanel.GetProjectWidget() projndx = wgt.GetSelection() project = wgt.GetString(projndx) - self.changeProject(ndx, project) # overkill, but it works for now. vwk + # overkill, but it works for now. vwk + self.changeProject(ndx, project) return else: ndx -= 1 - itemobj = self.topWindow.toppanel.GetItemObject(ndx) if itemobj == None: return - self.synchGridSelections(itemobj) - try: wxSafeYield() wxBeginBusyCursor() @@ -885,77 +918,64 @@ dlg.CentreOnParent() dlg.Show(True) self.showItem(itemobj) - finally: if dlg: dlg.Destroy() wxEndBusyCursor() - #print "end onitemclick" + # print "end onitemclick" def OnSelectProject(self, event = None): - #print "psmtool.onselectproject" + # print "psmtool.onselectproject" wgt = self.topWindow.toppanel.GetProjectWidget() - project = wgt.GetStringSelection() + selection = wgt.GetStringSelection() ndx = wgt.GetSelection() - if ndx == 0: + if selection == 'Select a Project': if state['currentprojectname']: - wgt.SetStringSelection(state['currentprojectname']) - wgt.SetSelection(wgt.FindString(state['currentprojectname'])) - self.dm.setCurrentProject(state['currentprojectname']) - project = wgt.GetStringSelection() + project = state.get('currentprojectname', 'None') + print 'currentprojectname = ', project + wgt.SetSelection(wgt.FindString(project)) + self.dm.setCurrentProject(project) ndx = wgt.GetSelection() - if ndx > 0: - self.changeProject(ndx, project) + self.changeProject(ndx, selection) def changeProject(self, ndx, projectname): - #print "psmtool.changeProject" - #print "project ndx", projectname, ndx - + # print "psmtool.changeProject" + # print "project ndx", projectname, ndx if self.itemeditform: self.itemeditform.SecureMode() prefs['lastproject'] = projectname - wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) - dlg = None - - if self.dm.user._loggedin: + if state['loggedin']: wxBeginBusyCursor() try: self.topWindow.toppanel.GetItemWidget().SetFocus() dlg = wxDialog(self, -1, - "A Message from PGEF", - wxDefaultPosition, wxSize(400, 75), - wxTHICK_FRAME) + "A Message from PGEF", + wxDefaultPosition, wxSize(400, 75), + wxTHICK_FRAME) msg = wxStaticText(dlg, -1, - "Please wait while PGEF retrieves the project data...", - wxPoint (10, 10), wxDefaultSize, - wxALIGN_CENTRE) + "Please wait while PGEF retrieves the project data...", + wxPoint (10, 10), wxDefaultSize, + wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) - state['currentprojectname'] = projectname self.dm.getItemsByProject([projectname]) - self.tree.DeleteAllItems() - numitems = self.FillGridFromProject(projectname) self.FillItemWidgetFromProject(projectname) - if numitems > 0: wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, True) - self.UpdateWindows() - if dlg: dlg.Destroy() self.SecureMenu() - except: if dlg: dlg.Destroy() @@ -968,40 +988,35 @@ self.modelgrid.ClearGrid() self.tree.DeleteAllItems() ndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() - if ndx > 0: - projectname = self.topWindow.toppanel.GetProjectWidget().GetStringSelection() + projectname = self.topWindow.toppanel.GetProjectWidget( + ).GetStringSelection() state['currentprojectname'] = projectname numitems = self.FillGridFromProject(projectname) self.FillItemWidgetFromProject(projectname) - if numitems > 0: wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, True) - self.UpdateWindows() self.SecureMenu() wxEndBusyCursor() - if ndx > 0: self.dm.setCurrentProject(projectname) - #print "end psmtool.changeProject" + # print "end psmtool.changeProject" def UpdateWindows(self): if self.projectframe: self.projectframe.Setup(state['currentprojectname']) - if self.itemeditform: self.itemeditform.OnClose() - if self.SearchFrame: self.SearchFrame.searchform.ClearForm() self.SearchFrame.searchgrid.ClearGrid() def UpdateWgts(self, newitem): - #print "psmtool.updatewgts" - #print 'DisplayWgts are: ', self.DisplayWgts + # print "psmtool.updatewgts" + # print 'DisplayWgts are: ', self.DisplayWgts for ndx in range(len(self.DisplayWgts)): wgt = self.DisplayWgts[ndx][0] wgttype = self.DisplayWgts[ndx][1] @@ -1011,8 +1026,6 @@ # only put models in the item dropdown foo = newitem.id wgt.AddData(foo, newitem) - - elif wgttype == "GRID": obj_type = self.DisplayWgts[ndx][2] class_type = newitem.__class__.__name__ @@ -1023,13 +1036,13 @@ def FillGridFromProject(self, projectname): - #print "psmtool.fillgridfromproject", projectname - localproducts = self.dm.getLocalObjectsOfTypes(["Part", "Model"], projectname) + # print "psmtool.fillgridfromproject", projectname + localproducts = self.dm.getLocalObjectsOfTypes(["Part", "Model"], + projectname) products = localproducts.values() uncommitted_oids = self.dm.getUncommittedOids() plist = [] mlist = [] - if len(products) > 0: for item in products: classname = item.__class__.__name__ @@ -1037,18 +1050,15 @@ plist.append([item.id, item]) elif classname == "Model": mlist.append([item.id, item]) - plist.sort() mlist.sort() - self.FillGridWithParts(self.itemgrid, plist, uncommitted_oids) self.FillGridWithModels(self.modelgrid, mlist, uncommitted_oids) - return len(products) def FillItemWidgetFromProject(self, projectname): - #print "psmtool.fillitemwgt" + # print "psmtool.fillitemwgt" localitems = self.dm.getLocalObjectsOfTypes(["Model"], projectname) localparts = localitems.values() itemlist = [] @@ -1059,75 +1069,52 @@ self.topWindow.toppanel.FillItemWidget(itemlist, "Select a Model") - def FillGridWithModels(self, grid, productlist, uncommitted_oids = None): - #print "fillgridwithmodels" + def FillGridWithModels(self, grid, productlist, uncommitted_oids=None): + # print "fillgridwithmodels" if uncommitted_oids == None: uncommitted_oids = [] grid.BeginBatch() grid.ClearGrid() for pname, product in productlist: if product.pgef_oid in uncommitted_oids: - #print pname, "is grey" + # print pname, "is grey" grid.AddData(product, colour = wxLIGHT_GREY) else: grid.AddData(product) - #grid.RefreshFromObjects() # rows that should be grey are not, if this executes. hmmm. + # rows that should be grey are not, if this executes. hmmm. + # grid.RefreshFromObjects() grid.AutoSizeColumns(True) grid.EndBatch() - def FillGridWithParts(self, grid, productlist, uncommitted_oids = None): - #print "fillgridwithparts" + def FillGridWithParts(self, grid, productlist, uncommitted_oids=None): + # print "fillgridwithparts" if uncommitted_oids == None: uncommitted_oids = [] grid.BeginBatch() grid.ClearGrid() for pname, product in productlist: - #print pname, product.id, product.pgef_oid + # print pname, product.id, product.pgef_oid if product.pgef_oid in uncommitted_oids: - #print pname, "is grey" + # print pname, "is grey" grid.AddData(product, colour = wxLIGHT_GREY) else: grid.AddData(product) - #grid.RefreshFromObjects() # rows that should be grey are not, if this executes. hmmm. + # rows that should be grey are not, if this executes. hmmm. + # grid.RefreshFromObjects() grid.AutoSizeColumns(True) grid.EndBatch() def FillLocalModeProjectWidget(self): - #print "psmtool.filllocalmodeprojectwidget" - -# ok, got rid of this 30mar2004 --vwk -## roles = self.dm.getRoles() -## tmp_roles = [] - -## if len(roles) < 3: -## tmp_role = Role() -## tmp_role.RoleCode = 'GDA' -## tmp_role.Userid = 'pbear' -## tmp_role.id = "pbear" -## tmp_role.project = 'H2G2' -## tmp_roles.append(tmp_role) - -## tmp_role = Role() -## tmp_role.RoleCode = 'GDA' -## tmp_role.Userid = 'test' -## tmp_role.id = "test" -## tmp_role.project = 'H2G2' -## tmp_roles.append(tmp_role) - -## self.dm.saveRoles(tmp_roles) -## roles = self.dm.getRoles() - + # print "psmtool.filllocalmodeprojectwidget" wgt = self.topWindow.toppanel.GetProjectWidget() wgt.Clear() wgt.Append('Select a project') - projects = self.dm.getProjects() if projects: for pkey, proj in projects.items(): wgt.Append(proj.id) wgt.Enable(True) - wgt.SetSelection(0) @@ -1139,14 +1126,13 @@ def SetupForLocalMode(self, event = None): - #print "setupforlocalmode" + # print "setupforlocalmode" self.FillLocalModeProjectWidget() self.Parent.sb.SetServer('Local') self.tree.DeleteAllItems() - state['currentuser'] = self.dm.user.id - - wgt = self.Parent.menuBar.FindMenuItem('Repository','Get Marked Items') + wgt = self.Parent.menuBar.FindMenuItem('Repository', + 'Get Marked Items') self.Parent.menuBar.Enable(wgt, False) wgt = self.topWindow.toppanel.GetProjectWidget() if state['currentprojectname']: @@ -1154,7 +1140,6 @@ if ndx <> wxNOT_FOUND: wgt.SetSelection(wgt.FindString(state['currentprojectname'])) wgt.SetStringSelection(state['currentprojectname']) - ndx = wgt.GetSelection() projectname = wgt.GetStringSelection() if ndx > 0: @@ -1162,13 +1147,14 @@ def SetupForLogin(self): - #print "setupforlogin" - wgt = self.Parent.menuBar.FindMenuItem('Repository', 'Get Marked Items') + # print "setupforlogin" + wgt = self.Parent.menuBar.FindMenuItem('Repository', + 'Get Marked Items') self.Parent.menuBar.Enable(wgt, True) def BuildTree(self, itemid): - #print "psmtool.buildtree" + # print "psmtool.buildtree" try: self.tree.DeleteAllItems() self.dm.clearNauoIDs() @@ -1179,7 +1165,7 @@ print "psmtool.buildtree.error" def OnEditComponent(self, event): - #print "psmtool.oneditcomponent" + # print "psmtool.oneditcomponent" evtobj = event.GetEventObject() if isinstance(evtobj, wxMenu): node = self.tree.GetSelection() @@ -1199,10 +1185,11 @@ pane = 0 elif classname == "Model": pane = 1 - #print 'product class is:', classname + # print 'product class is:', classname metadata = ["TREE", product_id, classname] - self.ShowEditFrame(rootobj = temp_obj, nodedata = metadata, mode = itemeditframe.BROWSE_MODE) - #self.ShowEditFrame(pane, 1, ["TREE", product_id, classname]) + self.ShowEditFrame(rootobj=temp_obj, + nodedata=metadata, + mode=itemeditframe.BROWSE_MODE) wxEndBusyCursor() wxSafeYield() @@ -1218,7 +1205,7 @@ def onGridDClick (self, event): - #print "ongriddclick" + # print "ongriddclick" row = event.GetRow() grid = event.GetEventObject() grid.SelectRow(row) @@ -1230,7 +1217,7 @@ print "psmtool.editgridobject", obj.id, obj.__class__.__name__ classname = obj.__class__.__name__ dlg = None - if self.dm.user._loggedin: + if state['loggedin']: wxBeginBusyCursor() dlg = wxDialog(self, -1, "A Message from PGEF", @@ -1238,19 +1225,23 @@ wxTHICK_FRAME) msg = wxStaticText(dlg, -1, "PGEF is retrieving the product data...", - wxPoint (10, 10), wxDefaultSize, + wxPoint(10, 10), wxDefaultSize, wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) metadata = ["GRID", obj.id, classname] - self.ShowEditFrame(rootobj = obj, nodedata = metadata, mode = itemeditframe.BROWSE_MODE) + self.ShowEditFrame(rootobj=obj, + nodedata=metadata, + mode=itemeditframe.BROWSE_MODE) wxEndBusyCursor() dlg.Destroy() else: metadata = ["GRID", obj.id, classname] - self.ShowEditFrame(rootobj = obj, nodedata = metadata, mode = itemeditframe.BROWSE_MODE) + self.ShowEditFrame(rootobj=obj, + nodedata=metadata, + mode=itemeditframe.BROWSE_MODE) #____________________________________________________________________________________ @@ -1260,8 +1251,15 @@ class MyApp(wxApp): def OnInit(self): - frame = wxFrame(NULL, -1, "PSM Toolkit", wxDefaultPosition, wxSize(800, 600)) - main = PSMTool(frame, -1, wxDefaultPosition, wxSize(800, 600)) + frame = wxFrame(NULL, + -1, + "PSM Toolkit", + wxDefaultPosition, + wxSize(800, 600)) + main = PSMTool(frame, + -1, + wxDefaultPosition, + wxSize(800, 600)) frame.Show(True) self.SetTopWindow(frame) return True Index: PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py diff -u PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.37 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.38 --- PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.37 Mon Jul 19 16:07:48 2004 +++ PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py Fri Aug 13 02:43:22 2004 @@ -21,9 +21,10 @@ from pangalactic.enterprise.workflow.workflow_wizard import WorkflowWizard import pangalactic.enterprise.workflow.wfdatatable as wfdatatable -import pangalactic.utils.toolstate as toolstate -import pangalactic.utils.pgdialogs as pgdialogs -import pangalactic.utils.toolframe as toolframe +from pangalactic.utils import toolstate +from pangalactic.utils import pgdialogs +from pangalactic.utils import toolframe +from pangalactic.utils.pgefstate import state WF_WIZARD = wxNewId() WF_SAVE = wxNewId() @@ -390,7 +391,7 @@ def UpdateForLogin(self): print "workflowoverview.updateforlogin tbd" - if self.dm.user._loggedin: + if state['loggedin']: self.State.currentuser = self.dm.user.id def SetupForLogin(self): Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.141 PanGalactic/pangalactic/utils/datamanager.py:1.142 --- PanGalactic/pangalactic/utils/datamanager.py:1.141 Thu Aug 12 17:25:17 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Fri Aug 13 02:43:23 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.141 $ +@version: $Revision: 1.142 $ """ -__version__ = "$Revision: 1.141 $"[11:-2] +__version__ = "$Revision: 1.142 $"[11:-2] import time import mx.DateTime @@ -33,6 +33,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils.httpupload import upload from pangalactic.utils.pgefexceptions import LocalStorageError +from pangalactic.utils.pgefstate import state from pangalactic.utils.preferences import prefs, readPrefs, writePrefs from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.xmlrpcinterface import XmlrpcInterface @@ -113,7 +114,7 @@ return self.localDB.getPasswd(pwd_id) def changePassword(self, login_pwd, new_pwd, userid="", secure=1): - #print "update local passwds" + # print "update local passwds" self.server.changePassword(new_pwd, userid) if userid == self.user.id: self.login(self.user.id, new_pwd, secure = secure) @@ -134,7 +135,7 @@ def getDisplayMap(self, mapname): foo = self.getDisplayConfig() if foo.has_key(mapname): - #print mapname, "map", foo[mapname] + # print mapname, "map", foo[mapname] return foo[mapname] else: print "dm.getdisplaymap: no entry for:", mapname, "wha' happened?" @@ -155,7 +156,7 @@ return self.localDB.getDict(self.localDB.ROLE) def saveRoles(self, roles): - #print "dm.saveroles" + # print "dm.saveroles" self.localDB.SaveRoles(roles) def getUsers(self): @@ -172,7 +173,7 @@ Create a new object with the current project as its 'project' attribute. """ - #print "dm.newobject" + # print "dm.newobject" if classname == "PgefFile": e = "PgefFile should not be initialized here. Use newPgefFile." raise ValueError, e @@ -219,7 +220,7 @@ Set the current project context, which will be used for all new objects that have a 'project' attribute. """ - #print "datamanager.setcurrentproject", projectname + # print "datamanager.setcurrentproject", projectname self.CurrentProject = None allprojects = self.localDB.getDict(self.localDB.PROJECT) for k, p in allprojects.items(): @@ -241,7 +242,7 @@ """ Oversees the login process and the loading of roles and project data. """ - #print "datamanager.login" + # print "datamanager.login" self.server = self._createServer(username, password, secure=secure) try: self.server.yo() @@ -253,7 +254,6 @@ prefs['userid'] = username self.watchdog.user = Person(id=username) self.watchdog.user._password = password - self.watchdog.user._loggedin = True print "NOTE: create tmp role - GDA. Remove RSN" tmp_roles = [] @@ -297,16 +297,18 @@ try: # only need to get the lowest level??? --vwk 8oct2003 - # need to make sure we get all the referenced objects filled in. pass in objs + # need to make sure we get all the referenced objects filled + # in. pass in objs print "NOTE: user is smallberries for testing" - fieldnames = {"owner" : "smallberries"} #self.user.id} # testing only - remove RSN + # testing only - remove RSN + fieldnames = {"owner" : "smallberries"} docs = self.server.getObjects("Document", fields=fieldnames, refs=0, subtypes=0, objs=None) - #print "docs", docs + # print "docs", docs # do we need to connect docs with parts/models? fieldnames = {"project" : projectlist[0]} @@ -315,14 +317,14 @@ refs=0, subtypes=0, objs=None) - #print "parts", parts + # print "parts", parts objs = self.server.getObjects("Model", fields=fieldnames, refs=0, subtypes=0, objs=None) - #print "obj", objs - #print "\n" + # print "obj", objs + # print "\n" except Exception, e: print "no items in project" import traceback @@ -331,7 +333,7 @@ return if docs: - #print "len docs", len(docs) + # print "len docs", len(docs) for doc in docs: tempobjlist.append(doc) classname = doc.__class__.__name__ @@ -339,7 +341,7 @@ print "retrieving a", classname, doc.id if objs: - #print "len objs", len(objs) + # print "len objs", len(objs) for item in objs: tempobjlist.append(item) classname = item.__class__.__name__ @@ -351,12 +353,12 @@ if len(tempobjlist) > 0: - #print "len downloaded objs", len(tempobjlist) + # print "len downloaded objs", len(tempobjlist) self.localDB.save(tempobjlist) - # tbd - need to revisit after the project info is ironed out - # as this will not work for more than 1 project - # in the server call. + # tbd - need to revisit after the project info is ironed out as + # this will not work for more than 1 project in the server + # call. currproject = projectlist[0] self.localDB.addProjectObjects(currproject, tempobjlist) @@ -366,10 +368,10 @@ def getOrganizations(self, context = None): - #print "getorganizations" + # print "getorganizations" objdict = self.localDB.getOrganizations(context) if not objdict: - if self.user._loggedin: + if state['loggedin']: objlist = self.server.getOrganizations(context) self.localDB.save(objlist, override = True) else: @@ -402,7 +404,8 @@ def getProjects(self): """ - Get the projects from the repository; save them locally, and return them as a list. + Get the projects from the repository; save them locally, and return + them as a list. """ if self.server: print "NOTE: project.id_context is TEST" @@ -425,7 +428,7 @@ def getLookupObject(self, pgef_oid): - #print "datamanager.getLookupObject", pgef_oid + # print "datamanager.getLookupObject", pgef_oid return self.localDB.getLookupObject(pgef_oid) @@ -457,8 +460,10 @@ def getNAUOByAssemblyID(self, assemblyIds): - """Retrieves all of the Acus associated with a list of assembly ids.""" - #print "datamanager.getnauobyassemblyid" + """ + Retrieves all of the Acus associated with a list of assembly ids. + """ + # print "datamanager.getnauobyassemblyid" retlist = [] objlist = [] @@ -483,7 +488,7 @@ classname = obj.__class__.__name__ if classname == "Acu": nauoobjs.append(obj) - #print obj.assembly.id, "->", obj.component.id + # print obj.assembly.id, "->", obj.component.id elif classname == "Part": itemobjs.append(obj) elif classname == "Model": @@ -497,7 +502,7 @@ updatedacuobjs = self.localDB.save(nauoobjs) # print "updatedacuobjs", updatedacuobjs - #add the nauos to the projectobject dictionary in localdb + # add the nauos to the projectobject dictionary in localdb self.localDB.addProjectObjects(self.CurrentProject.id, nauoobjs) if len(itemobjs) > 0: @@ -511,12 +516,12 @@ item = self.localDB.getLookupObject(obj.pgef_oid) retlist.append(item) - #print "end datamanager.getnauobyassemblyid" + # print "end datamanager.getnauobyassemblyid" return retlist def getLocalAcusByAssemblyID(self, assemblyId, project): - #print "datamanager.getlocalacusbyassemblyid" + # print "datamanager.getlocalacusbyassemblyid" localacus = self.localDB.GetLocalAcus(project) retlist = [] for acu_id, acuobj in localacus.items(): @@ -549,7 +554,7 @@ def getPartDocLinksByPartId(self, idlist): """Retrieves all of the DocPtRels associated with a Part ID""" - #print "datamanager.getpartdoclinkbypartid" + # print "datamanager.getpartdoclinkbypartid" for objid in ItemIdList: fieldnames = {"document" : objid} @@ -647,7 +652,7 @@ self.nauoIDs.clear() def uncommittedData(self): - #print "datamanager.uncommitteddata" + # print "datamanager.uncommitteddata" if not self.CurrentProject: return False @@ -663,7 +668,7 @@ def addAcu(self, acu_to_add, acu_parent): - #print "datamanager.addacu" + # print "datamanager.addacu" if acu_parent == 'ROOT': if self.nauoIDs.has_key("ROOT"): topdict = self.nauoIDs["ROOT"] @@ -699,7 +704,7 @@ self.nauoIDs[acu_to_add.assembly] = tmpdict elif self.nauoIDs.has_key(acu_to_add.assembly): - #print "adding to existing dict" + # print "adding to existing dict" tmpdict = self.nauoIDs[acu_to_add.assembly] tmplist = tmpdict[acu_parent.pgef_oid] try: @@ -710,7 +715,7 @@ tmpdict[acu_parent.pgef_oid] = tmplist self.nauoIDs[acu_to_add.assembly] = tmpdict else: - #print "make leaf a branch; i.e., need a new entry in nauoids" + # print "make leaf a branch; i.e., need a new entry in nauoids" newlist = [] newlist.append(acu_to_add.pgef_oid) newdict = {} @@ -736,11 +741,11 @@ def search(self, classattrdict): - #print "datamanager.search", classattrdict + # print "datamanager.search", classattrdict objs_to_hookup = self.localDB.getCommittedObjects() try: self.searchresults = self.server.search(classattrdict, objs_to_hookup) - #print "# results", len(self.searchresults) + # print "# results", len(self.searchresults) except: print "dm.search.xmlrpc.error" return [] @@ -749,7 +754,7 @@ def searchOrgs(self, attrlist): print "dm.searchorgs; more TBD RSN", attrlist print "NOTE: search returns fake results for now" - if self.user._loggedin: + if state['loggedin']: objlist = self.server.getOrganizations("TEST") #"CAGE") # CAGE will work RSN? self.localDB.save(objlist, override = True) self.searchresults = objlist @@ -759,7 +764,7 @@ def getSearchResults(self): - #print "datamanager.getsearchresults" + # print "datamanager.getsearchresults" if self.searchresults: return self.searchresults else: @@ -775,8 +780,8 @@ def getWorkflows(self, attrlist = None): - #print "datamanager.getworkflows" - if self.user._loggedin: + # print "datamanager.getworkflows" + if state['loggedin']: print "NOTE: dm.getworkflows.need to get workflows from server tbd" return self.localDB.GetWorkflows(attrlist) else: @@ -784,10 +789,10 @@ def saveWfProcessInstance(self, wf_obj, wfdata, recurse = True): - #print "dm.savewfprocessinstance" + # print "dm.savewfprocessinstance" wf_obj.wfdata = wfdata wf_obj.wfdata_name = wf_obj.wfdata.getName() - #print "wf_obj", wf_obj + # print "wf_obj", wf_obj self.localDB.SaveWfProcessInstance([wf_obj], recurse) @@ -795,7 +800,7 @@ print "dm.addwfprocessinstance" wf_obj.wfdata = wfdata wf_obj.wfdata_name = wf_obj.wfdata.getName() - #print "wf_obj", wf_obj + # print "wf_obj", wf_obj self.localDB.addWfProcessInstance([wf_obj], recurse) @@ -817,7 +822,7 @@ def getWfProcessTemplates(self): - #print "datamanager.getWfProcessTemplates" + # print "datamanager.getWfProcessTemplates" templatedict = self.localDB.GetLocalWorkflowTemplates() if len(templatedict) > 0: return templatedict @@ -832,7 +837,7 @@ def _uploadFile(self, obj_oid, file_name): if os.path.exists(file_name): - #print "have file to upload", file_name + # print "have file to upload", file_name ctype, encoding = mimetypes.guess_type(file_name) if ctype is None or encoding is not None: @@ -851,7 +856,7 @@ oid = obj_oid, mimetype = ctype) - #print "uploaded" + # print "uploaded" else: print "UploadError:", file_name + "does not exist" @@ -863,16 +868,16 @@ def commit(self, unsavedobjs): print "datamanager.commit" - if self.user._loggedin: - #print "logged in" + if state['loggedin']: + # print "logged in" if len(unsavedobjs) > 0: - #print "unsaved", len(unsavedobjs) + # print "unsaved", len(unsavedobjs) addlist = [] dellist = [] for obj in unsavedobjs: # check for unset attributes and commit-related stuff - #print "checking", obj.id, obj.name + # print "checking", obj.id, obj.name obj.creator = self.user.id if obj.owner == "": obj.owner = obj.creator @@ -894,11 +899,11 @@ actionlist = [] - #print "len addlist", len(addlist) + # print "len addlist", len(addlist) if len(addlist) > 0: - #print "call server add" + # print "call server add" # we should get back a list of updated objects - #print "updated objects are passed back at the end of the list" + # print "updated objects are passed back at the end of the list" objs_to_hookup = self.localDB.getCommittedObjects().values() objs_to_hookup.append(self.CurrentProject) retval = self.server.addObjects(addlist, objs_to_hookup) @@ -917,15 +922,15 @@ print "Commit to database failed - AddObjects" # if len(dellist) > 0: - #print "datamanager.commit.delete is TBD?" - #retval = self.server.CallServerFunction(dellist, "DelObjects", self.auth) - #if retval: + # print "datamanager.commit.delete is TBD?" + # retval = self.server.CallServerFunction(dellist, "DelObjects", self.auth) + # if retval: ## print "del failed" - #for obj in dellist: - #obj.state = None - #obj.pger_create_datetime = retval - #obj.pger_mod_datetime = retval - #actionlist.append(obj) + # for obj in dellist: + # obj.state = None + # obj.pger_create_datetime = retval + # obj.pger_mod_datetime = retval + # actionlist.append(obj) # else: # print "del succeeded" @@ -945,7 +950,7 @@ def getUncommittedOids(self): uncommitted_oids = self.localDB.GetUncommittedDict().keys() - #print "uncomm oids", uncommitted_oids + # print "uncomm oids", uncommitted_oids return uncommitted_oids def getUncommittedObjs(self): @@ -954,10 +959,10 @@ def getCategories(self, context): - #print "datamanager.getcategories" + # print "datamanager.getcategories" objdict = self.localDB.getCategories(context) if not objdict: - if self.user._loggedin: + if state['loggedin']: objlist = self.server.getCategories(context) self.localDB.saveCategories(context, objlist) else: @@ -967,7 +972,7 @@ def translateAttrinfo(self, attrinfo): - #print "dm.translateattrinfo", attrinfo + # print "dm.translateattrinfo", attrinfo if attrinfo[1] == "IS NOT": # print "NOTE: is not yet implemented?" server_info = (attrinfo[0], attrinfo[1], "NULL") @@ -986,7 +991,7 @@ def getFiles(self, obj_list): - #print "dm.getfiles", obj_list + # print "dm.getfiles", obj_list pgefoids = [a.pgef_oid for a in obj_list] attrlist = [("parent", "in", pgefoids)] @@ -996,22 +1001,22 @@ objs_to_link.extend(obj_list) local_files = self.localDB.getFiles(attrlist) objs_to_link.extend(local_files) - #print "classattrdict", classattrdict - if self.user._loggedin: - #print "search server" + # print "classattrdict", classattrdict + if state['loggedin']: + # print "search server" try: obj_files = self.server.search(classattrdict, objs_to_link) - #print "nfiles", len(obj_files) + # print "nfiles", len(obj_files) except Exception, e: print "EXCEPTION: dm.getfiles.xmlrpc.error" - #import traceback - #traceback.print_exc() + # import traceback + # traceback.print_exc() print e return [] self.save(obj_files) return obj_files else: - #print "search localdb" + # print "search localdb" return local_files @@ -1028,7 +1033,7 @@ newtime = timetuple.strftime("%m/%d/%Y %H:%M:%S") retval = None - if self.user._loggedin: + if state['loggedin']: if len(unsavedobjs) > 0: for obj in unsavedobjs: print "checking", obj.id @@ -1038,13 +1043,13 @@ elif obj.state == objectstatus.MODIFY: if obj.__class__.__name__ != "PgefFile": wfaddlist.append(obj) - else: #if obj.__class__.__name__ == "PgefFile": + else: # if obj.__class__.__name__ == "PgefFile": fileaddlist.append(obj) elif obj.state == objectstatus.ADD: if obj.__class__.__name__ != "PgefFile": wfaddlist.append(obj) - else: #if obj.__class__.__name__ == "PgefFile": + else: # if obj.__class__.__name__ == "PgefFile": fileaddlist.append(obj) print "setting is_head = True for", obj.__class__.__name__, obj.id Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.11 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.12 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.11 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Fri Aug 13 02:43:20 2004 @@ -4,21 +4,22 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.modelform_wdr import * class ModelForm(wxPanel, Security_Mixin): - def __init__(self, parent, id,state, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + def __init__(self, parent, id, + pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state self.CreatingModel = False self.EditingModel = False self.temp_model = None - + self.NextId = None Model_Func(self, True) @@ -161,7 +162,7 @@ self.clearForm() self.Enable(True) self.CreatingModel = True - self.GetPoc().SetValue(self.State.currentuser) + self.GetPoc().SetValue(state['currentuser']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.147 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.148 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.147 Thu Aug 12 17:25:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Fri Aug 13 02:43:20 2004 @@ -1,34 +1,22 @@ # $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ -__version__ = "$Revision: 1.147 $"[11:-2] +__version__ = "$Revision: 1.148 $"[11:-2] import copy import types from wxPython.wx import * -from pangalactic.client.dataobjects import partslistinfo -from pangalactic.client.dataobjects import partslistmap - -import pangalactic.client.modules.psm.docform as docform - +from pangalactic.client.dataobjects import partslistinfo +from pangalactic.client.dataobjects import partslistmap +from pangalactic.client.modules.psm import docform from pangalactic.client.modules.psm import partslistform from pangalactic.client.modules.psm import partslistview -from pangalactic.client.modules.psm import pgefdoctree +from pangalactic.client.modules.psm import pgefdoctree from pangalactic.client.modules.psm import pgefedittree from pangalactic.client.modules.psm import partform from pangalactic.client.modules.psm import modelform from pangalactic.client.modules.psm import propertiesform - -import pangalactic.enterprise.project as project - -from pangalactic.enterprise.document import Document -from pangalactic.enterprise.partslist import PartsList -#from pangalactic.enterprise.pgeffile import PgefFile - -import pangalactic.enterprise.part as part -import pangalactic.enterprise.model as model - from pangalactic.client.modules.psm import pgefversiontree from pangalactic.utils import objectstatus @@ -52,10 +40,18 @@ Encapsulates the logic for graphically editing a product """ - def __init__(self, parent, datamanager, rootobj, nodedata, displaywgts, mode): - toolframe.toolFrame.__init__(self, parent, -1, "Product: ", wxDefaultPosition, wxSize(750, 620)) - self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') - self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") + def __init__(self, parent, datamanager, rootobj, nodedata, + displaywgts, mode): + toolframe.toolFrame.__init__(self, + parent, + -1, + "Product: ", + wxDefaultPosition, + wxSize(750, 620)) + self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, + '&Close') + self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") self.CentreOnParent() self.Parent = parent @@ -76,8 +72,10 @@ self.tID = wxNewId() self.treeMap = {} self.tree = pgefedittree.PgefEditTree(self.vsplitter, self.tID, self.dm) - tree_tooltip = "A hierarchical display of the currently selected product. " + \ - "Click on a product to display its data on the Data tab on the Attributes tab." + tree_tooltip = ' '.join([ + "A hierarchical display of the currently selected product.", + "Click on a product to display its data on the Data tab on", + "the Attributes tab."]) self.tree.SetToolTip(wxToolTip(tree_tooltip)) self.currenttree = None self.modeltree = None @@ -85,23 +83,23 @@ self.doctree = None self.partform = partform.PartForm(self.editnb, -1) - self.editnb.AddPage(self.partform, "Part") - + self.editnb.AddPage(self.partform, + "Part") self.modelform = modelform.ModelForm(self.editnb, -1) - self.editnb.AddPage(self.modelform, "Model") - + self.editnb.AddPage(self.modelform, + "Model") self.propertiesform = propertiesform.PropertiesForm(self.editnb, -1) - self.editnb.AddPage(self.propertiesform, "Product Properties") - + self.editnb.AddPage(self.propertiesform, + "Product Properties") self.partslistform = partslistform.PartsListForm(self.editnb, -1) - self.editnb.AddPage(self.partslistform, "Parts Lists") - + self.editnb.AddPage(self.partslistform, + "Parts Lists") self.partslistview = partslistview.PartsListView(self.editnb, -1) - self.editnb.AddPage(self.partslistview, "Parts List Data") - + self.editnb.AddPage(self.partslistview, + "Parts List Data") self.documentform = docform.DocForm(self.editnb, -1) - self.editnb.AddPage(self.documentform, "Documents") - + self.editnb.AddPage(self.documentform, + "Documents") #notebook page indices self.PartPage = 0 self.ModelPage = 1 @@ -219,8 +217,8 @@ self.currentobj = self.dm.newObject(classname) self.tempobj = self.dm.newObject(classname) - self.currentobj(**rootobj.__dict__) - self.tempobj(**self.currentobj.__dict__) + self.currentobj.__dict__.update(rootobj.__dict__) + self.tempobj.__dict__.update(self.currentobj.__dict__) if classname == "Part": self.rootobjs[self.PartPage] = rootobj @@ -265,7 +263,6 @@ if currentform: currentform.fillForm(rootobj) - currentform._loggedin = self.dm.user._loggedin self.BuildTree(rootobj, classname) root = self.tree.GetRootItem() @@ -806,7 +803,6 @@ def OnPartsListView(self, event): #print "itemedit.onpartslistview" self.editnb.SetSelection(self.PartDataPage) - self.partslistview._loggedin = self.dm.user._loggedin self.partslistview.GetData(state['workingdir'], self.currentobj, self.dm.user, self.dm.serverHost, self.dm.serverPort) @@ -877,7 +873,7 @@ self.ImportPartsListFrame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") self.ImportPartsListFrame.SetDataManager(self.dm) - if self.dm.user._loggedin: + if state['mode'] != 'local': self.ImportPartsListFrame.sb.SetServer( ''.join([self.dm.serverHost, ':', @@ -986,16 +982,23 @@ #print "itemeditframe.buildtree" textloc = wxPoint(10, 10) defsize = wxSize(400, 75) - treedlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, defsize, wxTHICK_FRAME) - msg = wxStaticText(treedlg, -1, "Please wait while PGEF accesses the Item data...", - textloc, wxDefaultSize, wxALIGN_CENTRE) + treedlg = wxDialog(self, + -1, + "A Message from PGEF", + wxDefaultPosition, + defsize, + wxTHICK_FRAME) + msg = wxStaticText(treedlg, -1, + "Please wait while PGEF accesses the Item data...", + textloc, wxDefaultSize, wxALIGN_CENTRE) treedlg.CentreOnParent() treedlg.Show(True) if self.currenttree <> treetype: newtree = pgefedittree.PgefEditTree(self.vsplitter, self.tID, self.dm) - tree_tooltip = "A hierarchical display of the currently selected product. " + \ - "Click on a product to display its data on the Product tab." + tree_tooltip = ' '.join( + ["A hierarchical display of the currently selected product.", + "Click on a product to display its data on the Product tab."]) newtree.SetToolTip(wxToolTip(tree_tooltip)) self.vsplitter.ReplaceWindow(self.tree, newtree) self.tree = None @@ -1021,8 +1024,10 @@ self.currentdata = treedata if self.dm.creatingPartsList: if self.tempobj.pgef_oid <> self.currentobj.pgef_oid: - dlg = wxMessageDialog(self, "Discard unsaved Parts List changes?", - "Unsaved Data", wxOK | wxCANCEL | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "Discard unsaved Parts List changes?", + "Unsaved Data", + wxOK | wxCANCEL | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_OK: self.dm.creatingPartsList = False else: @@ -1047,8 +1052,8 @@ plobj = self.dm.getLookupObject(nodeid) self.currentobj = self.dm.newObject("PartsList") self.tempobj = self.dm.newObject("PartsList") - self.currentobj(**plobj.__dict__) - self.tempobj(**plobj.__dict__) + self.currentobj.__dict__.update(plobj.__dict__) + self.tempobj.__dict__.update(plobj.__dict__) self.partslistform.fillForm(self.currentobj) self.partslistform.BrowseMode(False) @@ -1061,8 +1066,10 @@ self.currentdata = treedata if self.dm.creatingPart: if self.tempobj.pgef_oid <> self.currentobj.pgef_oid: - dlg = wxMessageDialog(self, "Discard unsaved Part changes?", - "Unsaved Data", wxOK | wxCANCEL | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "Discard unsaved Part changes?", + "Unsaved Data", + wxOK | wxCANCEL | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_OK: self.dm.creatingPart = False else: @@ -1090,8 +1097,8 @@ if partobj: self.currentobj = self.dm.newObject("Part") self.tempobj = self.dm.newObject("Part") - self.currentobj(**partobj.__dict__) - self.tempobj(**partobj.__dict__) + self.currentobj.__dict__.update(partobj.__dict__) + self.tempobj.__dict__.update(partobj.__dict__) self.partform.fillForm(self.currentobj) elif self.currentpage == self.ModelPage: @@ -1103,8 +1110,10 @@ self.currentdata = treedata if self.dm.creatingModel: if self.tempobj.pgef_oid <> self.currentobj.pgef_oid: - dlg = wxMessageDialog(self, "Discard unsaved Model changes?", - "Unsaved Data", wxOK | wxCANCEL | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "Discard unsaved Model changes?", + "Unsaved Data", + wxOK | wxCANCEL | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_OK: self.dm.creatingModel = False else: @@ -1132,8 +1141,8 @@ if modelobj: self.currentobj = self.dm.newObject("Model") self.tempobj = self.dm.newObject("Model") - self.currentobj(**modelobj.__dict__) - self.tempobj(**modelobj.__dict__) + self.currentobj.__dict__.update(modelobj.__dict__) + self.tempobj.__dict__.update(modelobj.__dict__) self.modelform.fillForm(self.currentobj) elif self.currentpage == self.DocPage: @@ -1145,8 +1154,10 @@ self.currentdata = treedata if self.dm.creatingDocument: if self.tempobj.pgef_oid <> self.currentobj.pgef_oid: - dlg = wxMessageDialog(self, "Discard unsaved Document changes?", - "Unsaved Data", wxOK | wxCANCEL | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "Discard unsaved Document changes?", + "Unsaved Data", + wxOK | wxCANCEL | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_OK: self.dm.creatingDocument = False else: @@ -1171,8 +1182,8 @@ docobj = self.dm.getLookupObject(nodeid) self.currentobj = self.dm.newObject("Document") self.tempobj = self.dm.newObject("Document") - self.currentobj(**docobj.__dict__) - self.tempobj(**docobj.__dict__) + self.currentobj.__dict__.update(docobj.__dict__) + self.tempobj.__dict__.update(docobj.__dict__) self.documentform.fillForm(self.currentobj) self.documentform.BrowseMode(False) @@ -1185,34 +1196,30 @@ if self.dm.creatingPart: tmp = self.dm.newObject("Part") self.partform.fillObject(tmp) -# tmp = part.Part(_project = self.dm.CurrentProject) -# self.partform.fillForm(tmp) - #changed following line to use isEqual, was DataEqual if tmp.isEqual(self.currentobj): - print "dataequal:objects = tbd. what is supposed to be going on here?" + print ' '.join(["dataequal:objects = tbd.", + "what is supposed to be going on here?"]) else: retval = True if self.dm.creatingModel: tmp = self.dm.newObject("Model") self.modelform.fillObject(tmp) -# tmp = model.Model(_project = self.dm.CurrentProject) -# self.modelform.fillForm(tmp) - #changed following line to use isEqual, was DataEqual if tmp.isEqual(self.currentobj): - print "dataequal:objects = tbd. what is supposed to be going on here?" + print ' '.join(["dataequal:objects = tbd.", + "what is supposed to be going on here?"]) else: retval = True if self.dm.creatingPartsList: -# tmp = PartsList(id = 'tempid__11') tmp = self.dm.newObject("PartsList") self.partslistform.fillObject(tmp) #changed following line to use isEqual, was DataEqual if tmp.isEqual(self.currentobj): - print "dataequal:objects = tbd. what is supposed to be going on here?" + print ' '.join(["dataequal:objects = tbd.", + "what is supposed to be going on here?"]) else: retval = True @@ -1222,7 +1229,8 @@ self.documentform.fillObject(tmp) #changed following line to use isEqual, was DataEqual if tmp.isEqual(self.currentobj): - print "dataequal:objects = tbd. what is supposed to be going on here?" + print ' '.join(["dataequal:objects = tbd.", + "what is supposed to be going on here?"]) else: retval = True @@ -1247,14 +1255,18 @@ plid = int(plid) - 1 prefs['nextplid'] = plid writePrefs() - self.partslistform.NextDocId = str(int(self.partslistform.NextDocId) - 1) + self.partslistform.NextDocId = str( + int( + self.partslistform.NextDocId) - 1) if self.dm.creatingDocument: docid = prefs.get('nextdocid', 1) docid = int(docid) - 1 prefs['nextdocid'] = docid writePrefs() - self.documentform.NextDocId = str(int(self.documentform.NextDocId) - 1) + self.documentform.NextDocId = str( + int( + self.documentform.NextDocId) - 1) if self.dm.creatingPart: self.partform.revertNextId() @@ -1306,23 +1318,26 @@ elif self.dm.creatingPartsList: self.dm.creatingPartsList = False if self.PLMtool: - save_object._ColumnInfo = self.PLMtool.GetColumnInfo() - save_object._ColumnMapping = self.PLMtool.GetColumnMapping() - save_object._ColumnMappingID = 0 # eventually change to database id - save_object._upload_file_name = self.PLMtool.GetPartsListFilename() + PLM = self.PLMtool + save_object._ColumnInfo = PLM.GetColumnInfo() + save_object._ColumnMapping = PLM.GetColumnMapping() + save_object._ColumnMappingID = 0 + save_object._upload_file_name = PLM.GetPartsListFilename() else: if self.currentobj: - save_object._ColumnInfo = self.currentobj._ColumnInfo - save_object._ColumnMapping = self.currentobj._ColumnMapping + o = self.currentobj + save_object._ColumnInfo = o._ColumnInfo + save_object._ColumnMapping = o._ColumnMapping save_object._ColumnMappingID = 0 - save_object._upload_file_name = self.currentobj._upload_file_name + save_object._upload_file_name = o._upload_file_name else: return False if not save_object._upload_file_name: if wxPlatform == '__WXMSW__': if not self.PLM_Converted: - raise RequiredDataError, "You have not provided a spreadsheet" + msg = "You have not provided a spreadsheet" + raise RequiredDataError, msg else: self.PLM_Converted = True #vwk for linux testing @@ -1331,17 +1346,8 @@ self.dm.creatingDocument = False self.dm.add([save_object]) - self.dm.addProjectObjects(state['currentprojectname'], [save_object]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(state['currentprojectname']): -# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[save_object.pgef_oid] = save_object.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist + self.dm.addProjectObjects(state['currentprojectname'], + [save_object]) self.Parent.GetPSMTool().UpdateWgts(save_object) return True @@ -1399,8 +1405,8 @@ def SaveObject(self, itemid): """ - Save a new object (or changes to an existing object) into an object in - the local database. + Save a new object (or changes to an existing object) into an object + in the local database. @type itemid: string @param itemid: The oid of the object being edited. @@ -1432,8 +1438,6 @@ except RequiredDataError, e: print "e:", e.value -# dlg = wxMessageDialog(self, e.__dict__['args'], "Required Data Missing.", -# wxOK | wxICON_ERROR) dlg = wxMessageDialog(self, e.value, "Required Data Missing.", wxOK | wxICON_ERROR) dlg.ShowModal() @@ -1443,7 +1447,8 @@ save_object = None return - if self.currentobj.name == "NEW": #self.rootitemid == None and self.rootnauoid == None: + #self.rootitemid == None and self.rootnauoid == None: + if self.currentobj.name == "NEW": #print " new item via menu?" # we have created a new node via the menu if self.tree: @@ -1462,23 +1467,26 @@ if self.dm.creatingPartsList: if self.PLMtool: - save_object._ColumnInfo = self.PLMtool.GetColumnInfo() - save_object._ColumnMapping = self.PLMtool.GetColumnMapping() - save_object._ColumnMappingID = 0 # eventually change to database id - save_object._upload_file_name = self.PLMtool.GetPartsListFilename() + PLM = self.PLMtool + save_object._ColumnInfo = PLM.GetColumnInfo() + save_object._ColumnMapping = PLM.GetColumnMapping() + save_object._ColumnMappingID = 0 + save_object._upload_file_name = PLM.GetPartsListFilename() else: if self.currentobj: - save_object._ColumnInfo = self.currentobj._ColumnInfo - save_object._ColumnMapping = self.currentobj._ColumnMapping + o = self.currentobj + save_object._ColumnInfo = o._ColumnInfo + save_object._ColumnMapping = o._ColumnMapping save_object._ColumnMappingID = 0 - save_object._upload_file_name = self.currentobj._upload_file_name + save_object._upload_file_name = o._upload_file_name else: return False if not save_object._upload_file_name: if wxPlatform == '__WXMSW__': if not self.PLM_Converted: - raise RequiredDataError, "You have not provided a spreadsheet" + msg = "You have not provided a spreadsheet" + raise RequiredDataError, msg else: self.PLM_Converted = True #vwk for linux testing self.SetPartsListInfo(pl) @@ -1496,20 +1504,10 @@ save_object.state = objectstatus.ADD self.dm.add([save_object]) - self.currentobj(**save_object.__dict__) - self.tempobj(**save_object.__dict__) - - self.dm.addProjectObjects(state['currentprojectname'], [save_object]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(state['currentprojectname']): -# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[save_object.pgef_oid] = save_object.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist + self.currentobj.__dict__.update(save_object.__dict__) + self.tempobj.__dict__.update(save_object.__dict__) + self.dm.addProjectObjects(state['currentprojectname'], + [save_object]) return save_object From waterbug at ned.gsfc.nasa.gov Fri Aug 13 03:27:30 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 13 03:27:32 2004 Subject: [Pangalactic-commits] Mostly OCD text-wrapping fanaticism ... Message-ID: <200408130727.i7D7RUpU014190@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.148 1.149 Log message: Mostly OCD text-wrapping fanaticism ... Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.148 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.149 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.148 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Fri Aug 13 03:27:29 2004 @@ -1,6 +1,6 @@ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemeditframe.py,v $ +# $Id: itemeditframe.py,v 1.149 2004/08/13 07:27:29 waterbug Exp $ -__version__ = "$Revision: 1.148 $"[11:-2] +__version__ = "$Revision: 1.149 $"[11:-2] import copy import types @@ -298,19 +298,22 @@ self.DisplayWgts = display_wgts - def UnsavedDataPageChanging(self, dialog_msg, creating_flag, currentpage, allow_tabbing = True): + def UnsavedDataPageChanging(self, dialog_msg, creating_flag, + currentpage, allow_tabbing = True): """ - Does the actual grunt work of the checking when a tab changes - In the next incarnation, will put message in the statusbar instead + Does the actual grunt work of the checking when a tab changes In + the next incarnation, will put message in the statusbar instead @type msg: string @param msg: The message that is to show in the dialog box @type creating_flag: boolean - @param creating_flag: The flag that is used to determin if we are in a creating or editing mode + @param creating_flag: The flag that is used to determin if we are + in a creating or editing mode @rtype boolean - @return returns True if they want to remain in creating mode, False otherwise + @return returns True if they want to remain in creating mode, + False otherwise """ if creating_flag: @@ -337,24 +340,28 @@ #print 'currentpage in pagechanging is: ' , self.currentpage if self.currentpage == self.PartPage: - self.dm.creatingPart = self.UnsavedDataPageChanging("Discard unsaved Part changes?", - self.dm.creatingPart, - self.currentpage) + self.dm.creatingPart = self.UnsavedDataPageChanging( + "Discard unsaved Part changes?", + self.dm.creatingPart, + self.currentpage) elif self.currentpage == self.ModelPage: - self.dm.creatingModel = self.UnsavedDataPageChanging("Discard unsaved Model changes?", - self.dm.creatingModel, - self.currentpage) + self.dm.creatingModel = self.UnsavedDataPageChanging( + "Discard unsaved Model changes?", + self.dm.creatingModel, + self.currentpage) elif self.currentpage == self.PartsListPage: - self.dm.creatingPartsList = self.UnsavedDataPageChanging("Discard unsaved Parts List changes?", - self.dm.creatingPartsList, - self.currentpage) + self.dm.creatingPartsList = self.UnsavedDataPageChanging( + "Discard unsaved Parts List changes?", + self.dm.creatingPartsList, + self.currentpage) elif self.currentpage == self.DocPage: - self.dm.creatingDocument = self.UnsavedDataPageChanging("Discard unsaved Document changes?", - self.dm.creatingDocument, - self.currentpage) + self.dm.creatingDocument = self.UnsavedDataPageChanging( + "Discard unsaved Document changes?", + self.dm.creatingDocument, + self.currentpage) def PageChanged(self, event=None): #print "itemeditframe.pagechanged" @@ -370,10 +377,13 @@ self.sb.ClearMsg() else: - self.sb.SetMsg('Currently editing on %s tab' % self.tabnames[self.editingtab]) + self.sb.SetMsg( + 'Currently editing on %s tab' % self.tabnames[ + self.editingtab]) return else: - self.setMode() # added to set modes for non-editing notebook tabs. vwk. + # added to set modes for non-editing notebook tabs. vwk. + self.setMode() if self.rootobjs[self.currentpage]: self.setCurrentObject(self.rootobjs[self.currentpage]) @@ -484,7 +494,8 @@ self.dm.creatingDocument = True def SecureMode(self): - actions = self.Parent.WatchDog.GetActions(state['currentprojectname']) + actions = self.Parent.WatchDog.GetActions( + state['currentprojectname']) self.partform.SetAllowed(actions) self.modelform.SetAllowed(actions) self.partslistform.SetAllowed(actions) @@ -504,7 +515,8 @@ else: obj = self.doctree.GetItemText(node) if obj <> "NEW": - self.documentform.ResetForm(self.dm.getLookupObject(obj[1])) + self.documentform.ResetForm( + self.dm.getLookupObject(obj[1])) else: self.documentform.ClearForm() self.documentform.BrowseMode(False) @@ -538,9 +550,12 @@ rootnode = self.doctree.GetRootItem() if node == rootnode: treeid = self.doctree.AppendItem(node, self.currentobj.id) - self.doctree.SetPyData(treeid, [link.pgef_oid, self.currentobj.pgef_oid]) + self.doctree.SetPyData(treeid, + [link.pgef_oid, + self.currentobj.pgef_oid]) self.doctree.SetItemImage(treeid, self.doctree.partslisticon) - self.doctree.SetItemImage(treeid, self.doctree.partslisticon, wxTreeItemIcon_Selected) + self.doctree.SetItemImage(treeid, self.doctree.partslisticon, + wxTreeItemIcon_Selected) if not self.doctree.IsExpanded(rootnode): self.doctree.Expand(rootnode) @@ -559,16 +574,6 @@ self.dm.add([link]) self.dm.addProjectObjects(state['currentprojectname'], [link]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(state['currentprojectname']): -# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[link.pgef_oid] = link.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist rootdata = self.tree.GetPyData(self.tree.GetRootItem()) parent = self.dm.getLookupObject(rootdata[1]) @@ -638,10 +643,11 @@ self.partform.ResetForm(temp_obj) self.partform.revertNextId() else: - print "\n\nATTENTION: itemeditframe.resetproduct" - print " have node; is this section of code ever called???" - print " maybe not, since we only edit the root\n\n" - + msg = '\n '.join([ + "\n\nATTENTION: itemeditframe.resetproduct", + "have node; is this section of code ever called???", + "maybe not, since we only edit the root\n\n"]) + print msg obj = self.tree.GetItemText(node) if obj <> "NEW": temp_obj = self.dm.getLookupObject(obj[1]) @@ -690,10 +696,11 @@ self.modelform.ResetForm(temp_obj) self.modelform.revertNextId() else: - print "\n\nATTENTION: itemeditframe.resetproduct" - print " have node; is this section of code ever called???" - print " maybe not, since we only edit the root\n\n" - + msg = '\n '.join([ + "\n\nATTENTION: itemeditframe.resetproduct", + "have node; is this section of code ever called???", + "maybe not, since we only edit the root\n\n"]) + print msg obj = self.modeltree.GetItemText(node) if obj <> "NEW": temp_obj = self.dm.getLookupObject(obj[1]) @@ -764,25 +771,20 @@ self.dm.add([link]) self.dm.addProjectObjects(state['currentprojectname'], [link]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(state['currentprojectname']): -# projlist = self.dm.localDB.GetProjectObjects()[state['currentprojectname']] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[link.pgef_oid] = link.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[state['currentprojectname']] = projlist - node = self.partslisttree.GetSelection() rootnode = self.partslisttree.GetRootItem() if node == self.partslisttree.GetRootItem(): - treeid = self.partslisttree.AppendItem(node, self.currentobj.id) - self.partslisttree.SetPyData(treeid, [link.pgef_oid, self.currentobj.pgef_oid]) - self.partslisttree.SetItemImage(treeid, self.partslisttree.partslisticon) - self.partslisttree.SetItemImage(treeid, self.partslisttree.partslisticon, wxTreeItemIcon_Selected) + treeid = self.partslisttree.AppendItem(node, + self.currentobj.id) + self.partslisttree.SetPyData(treeid, + [link.pgef_oid, + self.currentobj.pgef_oid]) + self.partslisttree.SetItemImage(treeid, + self.partslisttree.partslisticon) + self.partslisttree.SetItemImage(treeid, + self.partslisttree.partslisticon, + wxTreeItemIcon_Selected) if not self.partslisttree.IsExpanded(rootnode): self.partslisttree.Expand(rootnode) self.partslistform.BrowseMode(True) @@ -803,12 +805,14 @@ def OnPartsListView(self, event): #print "itemedit.onpartslistview" self.editnb.SetSelection(self.PartDataPage) - self.partslistview.GetData(state['workingdir'], self.currentobj, self.dm.user, - self.dm.serverHost, self.dm.serverPort) + self.partslistview.GetData(state['workingdir'], self.currentobj, + self.dm.user, self.dm.serverHost, + self.dm.serverPort) def OnNewPart(self, event): """ - Handles the setting of the correct flags and modes for creating a product + Handle the setting of the correct flags and modes for creating a + product. @type event: wxEvent @param event: wxEvent Object passed by event loop @@ -822,7 +826,8 @@ def OnNewModel(self, event): """ - Handles the setting of the correct flags and modes for creating a product + Handle the setting of the correct flags and modes for creating a + product. @type event: wxEvent @param event: wxEvent Object passed by event loop @@ -868,9 +873,17 @@ self.ClosingPLMtool = False try: defsize = wxSize(800, 500) - self.ImportPartsListFrame = toolframe.toolFrame(self, -1, "Import Parts List Data", wxDefaultPosition, defsize) - self.ImportPartsListFrame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') - self.ImportPartsListFrame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") + self.ImportPartsListFrame = toolframe.toolFrame(self, + -1, + "Import Parts List Data", + wxDefaultPosition, + defsize) + self.ImportPartsListFrame.menuBar.SetLabel( + toolframe.ID_FILE_EXIT, + '&Close') + self.ImportPartsListFrame.menuBar.SetHelpString( + toolframe.ID_FILE_EXIT, + "Close this window") self.ImportPartsListFrame.SetDataManager(self.dm) if state['mode'] != 'local': @@ -883,12 +896,16 @@ self.PLMtool = PLMTool(self.ImportPartsListFrame, self, self.dm, -1, wxDefaultPosition, defsize) - self.PLMtool.SetColumnInfo(self.currentobj._ColumnInfo, self.partslistview.partslistgrid.GetNumberCols()) + self.PLMtool.SetColumnInfo(self.currentobj._ColumnInfo, + self.partslistview.partslistgrid.GetNumberCols()) self.ImportPartsListFrame.CentreOnParent() self.ImportPartsListFrame.Show(True) - EVT_CLOSE(self.ImportPartsListFrame, self.OnCloseImportPartsListFrame) - EVT_MENU(self.ImportPartsListFrame, PLM_FILE_CLOSE_ITEM, self.OnCloseImportPartsListFrame) + EVT_CLOSE(self.ImportPartsListFrame, + self.OnCloseImportPartsListFrame) + EVT_MENU(self.ImportPartsListFrame, + PLM_FILE_CLOSE_ITEM, + self.OnCloseImportPartsListFrame) if not self.PLMtool.onSelectSource(): self.OnCloseImportPartsListFrame() @@ -906,11 +923,11 @@ else: self.ClosingPLMtool = True if self.PLMtool: - self.currentobj._ColumnInfo = self.PLMtool.GetColumnInfo() - self.currentobj._ColumnMapping = self.PLMtool.GetColumnMapping() + PLM = self.PLMtool + self.currentobj._ColumnInfo = PLM.GetColumnInfo() + self.currentobj._ColumnMapping = PLM.GetColumnMapping() self.currentobj._ColumnMappingID = 0 - self.currentobj._upload_file_name = self.PLMtool.GetPartsListFilename() - + self.currentobj._upload_file_name = PLM.GetPartsListFilename() self.PLM_Converted = self.PLMtool.Converted self.PLMtool.CloseDown() @@ -933,7 +950,8 @@ else: obj = self.partslisttree.GetItemText(node) if obj <> "NEW": - self.partslistform.ResetForm(self.dm.getLookupObject(obj[1])) + self.partslistform.ResetForm( + self.dm.getLookupObject(obj[1])) else: self.partslistform.ClearForm() self.partslistform.BrowseMode(False) @@ -942,7 +960,9 @@ else: self.partslistform.BrowseMode(True) self.editingtab = None - self.partslistform.NextDocId = str(int(self.partslistform.NextDocId) - 1) + self.partslistform.NextDocId = str( + int( + self.partslistform.NextDocId) - 1) #print "end resetpartslist" @@ -953,7 +973,10 @@ self.dm.refresh = True if self.ChangesMade(): - dlg = wxMessageDialog(self, "Save changes?", "Unsaved Data", wxYES_NO | wxICON_EXCLAMATION) + dlg = wxMessageDialog(self, + "Save changes?", + "Unsaved Data", + wxYES_NO | wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_YES: # retval = self.SaveChanges() retval = self.saveObjectChanges() From waterbug at ned.gsfc.nasa.gov Sat Aug 14 19:54:46 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sat Aug 14 19:54:49 2004 Subject: [Pangalactic-commits] Fixed search for person; more OCD line-wrapping. Message-ID: <200408142354.i7ENskCY028622@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/cagesearchframe.py 1.2 1.3 PanGalactic/pangalactic/utils/datamanager.py 1.142 1.143 PanGalactic/pangalactic/utils/objectreport.py 1.13 1.14 PanGalactic/pangalactic/utils/userinfo.py 1.5 1.6 PanGalactic/pangalactic/utils/userrequest.py 1.2 1.3 PanGalactic/pangalactic/utils/usersearchframe.py 1.5 1.6 PanGalactic/pangalactic/utils/usersearchgui.py 1.5 1.6 PanGalactic/pangalactic/utils/xmlrpcinterface.py 1.69 1.70 Log message: Fixed search for person; more OCD line-wrapping. Index: PanGalactic/pangalactic/utils/userrequest.py diff -u PanGalactic/pangalactic/utils/userrequest.py:1.2 PanGalactic/pangalactic/utils/userrequest.py:1.3 --- PanGalactic/pangalactic/utils/userrequest.py:1.2 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/userrequest.py Sat Aug 14 19:54:45 2004 @@ -14,8 +14,8 @@ class UserRequest(wxPanel): def __init__(self, parent, id, datamgr, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL): + pos=wxPyDefaultPosition, size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.dm = datamgr UserRequestFunc(self, True) @@ -32,8 +32,9 @@ print "new_user", user_info.email self.dm.requestUser(user_info) else: - errdlg = wxMessageDialog(self, "You must enter information in all required fields.", - "Insufficient Data", wxOK | wxICON_EXCLAMATION) + errdlg = wxMessageDialog(self, + "You must enter information in all required fields.", + "Insufficient Data", wxOK | wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() errdlg.Destroy() @@ -43,7 +44,7 @@ # print "userrequest.validate" curr_user = self.getUser() if curr_user.fname and curr_user.lname and \ - curr_user.email and curr_user.org_oid: + curr_user.email and curr_user.org: curr_user.state = objectstatus.ADD self.dm.add([curr_user]) return True @@ -59,13 +60,13 @@ org_oid = self.getOrgWgt().GetValue() phone = self.getPhoneWgt().GetValue() - new_user = Person(fname = fname, - lname = lname, - mi_or_name = mi_or_name, - email = email, - position_title = position_title, - org_oid = org_oid, - phone = phone) + new_user = Person(fname=fname, + lname=lname, + mi_or_name=mi_or_name, + email=email, + position_title=position_title, + org=org_oid, + phone=phone) # print "new_user", new_user.email return new_user Index: PanGalactic/pangalactic/utils/cagesearchframe.py diff -u PanGalactic/pangalactic/utils/cagesearchframe.py:1.2 PanGalactic/pangalactic/utils/cagesearchframe.py:1.3 --- PanGalactic/pangalactic/utils/cagesearchframe.py:1.2 Mon Jun 7 13:21:49 2004 +++ PanGalactic/pangalactic/utils/cagesearchframe.py Sat Aug 14 19:54:44 2004 @@ -1,16 +1,16 @@ -from wxPython.wx import * +from wxPython.wx from * -import pangalactic.enterprise.organization as organization -import pangalactic.utils.cagesearchgui as cagesearchgui -import pangalactic.utils.orggrid as orggrid -import pangalactic.utils.toolframe as toolframe -import pangalactic.utils.objectstatus as objectstatus +from pangalactic.utils import cagesearchgui +from pangalactic.utils import orggrid +from pangalactic.utils import toolframe +from pangalactic.utils import objectstatus class CageSearchFrame(toolframe.toolFrame): CAGE_RESULTS_GRID = wxNewId() - def __init__(self, parent, id, title, datamanager, pos = wxDefaultPosition, size = wxDefaultSize): - toolframe.toolFrame.__init__(self, parent, id, title, size = size) + def __init__(self, parent, id, title, datamanager, + pos=wxDefaultPosition, size=wxDefaultSize): + toolframe.toolFrame.__init__(self, parent, id, title, size=size) self.Parent = parent self.SetDataManager(datamanager) self.sb.SetUser(self.dm.user.id) @@ -25,8 +25,8 @@ self.resultsgrid = orggrid.OrgGrid(self.searchnb, self.CAGE_RESULTS_GRID, - classname = "Organization", - localdb = self.dm.localDB) + classname="Organization", + localdb=self.dm.localDB) self.resultsgrid.allow_config_flag = False # at least for now # self.resultsgrid.SetRowLabelSize(0) @@ -38,14 +38,16 @@ self.searchnb.AddPage(self.resultsgrid, "Search Results") EVT_BUTTON(self, self.searchgui.getSearchWgt().GetId(), self.onSearch) - EVT_BUTTON(self, self.searchgui.getLuckySearchWgt().GetId(), self.onSearch) + EVT_BUTTON(self, self.searchgui.getLuckySearchWgt().GetId(), + self.onSearch) EVT_BUTTON(self, self.searchgui.getClearWgt().GetId(), self.onClear) EVT_BUTTON(self, self.searchgui.getCloseWgt().GetId(), self.onClose) - self.HelpText = "Entering text into any field adds that to the\n" + \ - "list of search criteria.\n\n" + \ - "You must enter text in at least one of the fields\n" + \ - "to initiate a search." + self.HelpText = '\n'.join([ + "Entering text into any field adds that to the" + "list of search criteria.\n" + "You must enter text in at least one of the fields" + "to initiate a search."]) self.AppTitle = "Searching for Users" self.org_frame = None @@ -72,14 +74,18 @@ return # for now; maybe permanent tmpsize = wxSize(650, 500) - self.org_frame = toolframe.toolFrame(self, -1, "Cage Data", wxDefaultPosition, tmpsize) + self.org_frame = toolframe.toolFrame(self, -1, "Cage Data", + wxDefaultPosition, tmpsize) self.org_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, "&Close") - self.org_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") - self.user_info = orginfo.OrgInfo(self.org_frame, -1, self.curr_org, datamgr = self.dm) + self.org_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") + self.user_info = orginfo.OrgInfo(self.org_frame, -1, + self.curr_org, datamgr=self.dm) self.org_frame.CentreOnParent() self.org_frame.Show(True) EVT_CLOSE(self.org_frame, self.onCloseUserFrame) - EVT_BUTTON(self.org_frame, self.user_info.getCloseWgt().GetId(), self.onCloseUserFrame) + EVT_BUTTON(self.org_frame, self.user_info.getCloseWgt().GetId(), + self.onCloseUserFrame) def onCloseUserFrame(self, event): @@ -102,7 +108,8 @@ luckytext = self.searchgui.getLuckyText().strip() attrdict = {} if len(luckytext) > 0: - attrdict = {"Organization":[("lucky", self.searchgui.getLuckyText())]} + attrdict = {"Organization":[("lucky", + self.searchgui.getLuckyText())]} else: print "normal" lucky = False @@ -110,10 +117,10 @@ if len(attrdict) == 0: if lucky: - moretext = "Hmmm. You can't get lucky without a search string." + txt = "Hmmm. You can't get lucky without a search string." else: - moretext = "Hmmm. You must specify at least one search criterion." - moredlg = wxMessageDialog(self, moretext, + txt = "Hmmm. You must specify at least one search criterion." + moredlg = wxMessageDialog(self, txt, "Insufficient Data", wxOK | wxICON_EXCLAMATION) moredlg.CentreOnParent() @@ -138,10 +145,11 @@ self.resultsgrid.AutoSizeColumns() if ndx > 0: # the search results tab visible - self.resultsgrid.GetParent().SetSelection(self.ResultsPage) + self.resultsgrid.GetParent().SetSelection(self.ResultsPage) else: noresultsdlg = wxMessageDialog(self, "No Results Found", - "Search Error", wxOK | wxICON_EXCLAMATION) + "Search Error", + wxOK | wxICON_EXCLAMATION) noresultsdlg.CentreOnParent() noresultsdlg.ShowModal() noresultsdlg.Destroy() Index: PanGalactic/pangalactic/utils/usersearchframe.py diff -u PanGalactic/pangalactic/utils/usersearchframe.py:1.5 PanGalactic/pangalactic/utils/usersearchframe.py:1.6 --- PanGalactic/pangalactic/utils/usersearchframe.py:1.5 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/usersearchframe.py Sat Aug 14 19:54:45 2004 @@ -1,29 +1,38 @@ -from wxPython.wx import * +# $Id: usersearchframe.py,v 1.6 2004/08/14 23:54:45 waterbug Exp $ +""" +wx frame for doing searches for users. + +@version: $Revision: 1.6 $ +""" +__version__ = "$Revision: 1.6 $"[11:-2] -import pangalactic.enterprise.person as person +from wxPython.wx import * -import pangalactic.utils.toolframe as toolframe -import pangalactic.utils.usergrid as usergrid -import pangalactic.utils.userinfo as userinfo -import pangalactic.utils.usersearchgui as usersearchgui -import pangalactic.utils.objectstatus as objectstatus +from pangalactic.utils import toolframe +from pangalactic.utils import usergrid +from pangalactic.utils import userinfo +from pangalactic.utils import usersearchgui +from pangalactic.utils import objectstatus +from pangalactic.utils.pgefstate import state class UserSearchFrame(toolframe.toolFrame): USER_SEARCH_GRID = wxNewId() - - def __init__(self, parent, id, title, datamanager, size = wxDefaultSize): - toolframe.toolFrame.__init__(self, parent, id, title, size = size) + + def __init__(self, parent, id, title, datamanager, size=wxDefaultSize): + toolframe.toolFrame.__init__(self, parent, id, title, size=size) self.Parent = parent self.SetDataManager(datamanager) - self.sb.SetUser(self.dm.user.id) + self.sb.SetUser(state['currentuser']) self.curr_user = None self.user_frame = None self.user_info = None - - self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, "&Close") - self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") - + + self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, + "&Close") + self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") + self.searchnb = wxNotebook(self, -1) self.searchgui = usersearchgui.UserSearchGui(self.searchnb, -1) self.CriteriaPage = 0 # used as identifier when anually switching tabs @@ -33,7 +42,7 @@ self.USER_SEARCH_GRID, classname = "Person", localdb = self.dm.localDB) - + self.resultsgrid.allow_config_flag = False # at least for now self.resultsgrid.SetRowLabelSize(0) self.resultsgrid.EnableEditing(false) @@ -47,10 +56,11 @@ EVT_BUTTON(self, self.searchgui.getClearWgt().GetId(), self.onClear) EVT_BUTTON(self, self.searchgui.getCloseWgt().GetId(), self.onClose) - self.HelpText = "Entering text into any field adds that to the\n" + \ - "list of search criteria.\n\n" + \ - "You must enter text in at least one of the fields\n" + \ - "to initiate a search." + self.HelpText = '\n'.join([ + "Entering text into any field adds that to the", + "list of search criteria.\n", + "You must enter text in at least one of the fields", + "to initiate a search."]) self.AppTitle = "Searching for Users" @@ -75,7 +85,7 @@ curr_user.state = objectstatus.ADD self.resultsgrid.Refresh(True) self.dm.add([curr_user]) - + def onApproveUser(self, event): print "usersearchframe.approveuser" @@ -85,7 +95,7 @@ self.resultsgrid.Refresh(True) self.dm.add([curr_user]) self.dm.approveUser(curr_user) - + def onDisableUser(self, event): print "usersearchframe.disableuser" @@ -101,20 +111,28 @@ if self.user_frame: self.user_frame.Raise() return - + tmpsize = wxSize(650, 500) - self.user_frame = toolframe.toolFrame(self, -1, "User Data", wxDefaultPosition, tmpsize) - self.user_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, "&Close") - self.user_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") + self.user_frame = toolframe.toolFrame(self, -1, + "User Data", + wxDefaultPosition, + tmpsize) + self.user_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, + "&Close") + self.user_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") self.user_info = userinfo.UserInfo(self.user_frame, -1, - mode = mode, - user_info = user_info, - datamgr = self.dm) + mode=mode, + user_info=user_info, + datamgr=self.dm) self.user_frame.CentreOnParent() self.user_frame.Show(True) - EVT_CLOSE(self.user_frame, self.onCloseUserFrame) - EVT_BUTTON(self.user_frame, self.user_info.getCloseWgt().GetId(), self.onCloseUserFrame) - + EVT_CLOSE(self.user_frame, + self.onCloseUserFrame) + EVT_BUTTON(self.user_frame, + self.user_info.getCloseWgt().GetId(), + self.onCloseUserFrame) + def onCloseUserFrame(self, event): #print "usersearchframe.oncloseuserframe" @@ -122,18 +140,19 @@ self.user_frame = None self.dm.saveUser(self.curr_user) - + def onClose(self, event): self.Show(False) - + def onSearch(self, event): print "usersearchframe.onsearch" self.resultsgrid.ClearGrid() attrdict = self.searchgui.getSearchCriteria() - + if len(attrdict) == 0: - nocriteriadlg = wxMessageDialog(self, "Hmmm. You need to specify at least one search parameter.", - "Insufficient Data", wxOK | wxICON_EXCLAMATION) + nocriteriadlg = wxMessageDialog(self, + "Hmmm. You need to specify at least one search parameter.", + "Insufficient Data", wxOK | wxICON_EXCLAMATION) nocriteriadlg.CentreOnParent() nocriteriadlg.ShowModal() nocriteriadlg.Destroy() @@ -158,12 +177,14 @@ # the search results tab visible self.resultsgrid.GetParent().SetSelection(self.ResultsPage) else: - noresultsdlg = wxMessageDialog(self, "No Results Found", - "Search Error", wxOK | wxICON_EXCLAMATION) + noresultsdlg = wxMessageDialog(self, + "No Results Found", + "Search Error", + wxOK | wxICON_EXCLAMATION) noresultsdlg.CentreOnParent() noresultsdlg.ShowModal() noresultsdlg.Destroy() - + def onClear(self, event): self.searchgui.clearForm() Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.142 PanGalactic/pangalactic/utils/datamanager.py:1.143 --- PanGalactic/pangalactic/utils/datamanager.py:1.142 Fri Aug 13 02:43:23 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Sat Aug 14 19:54:45 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.142 $ +@version: $Revision: 1.143 $ """ -__version__ = "$Revision: 1.142 $"[11:-2] +__version__ = "$Revision: 1.143 $"[11:-2] import time import mx.DateTime @@ -765,10 +765,7 @@ def getSearchResults(self): # print "datamanager.getsearchresults" - if self.searchresults: - return self.searchresults - else: - return [] + return getattr(self, 'searchresults', []) def getUncommittedWorkflows(self): Index: PanGalactic/pangalactic/utils/objectreport.py diff -u PanGalactic/pangalactic/utils/objectreport.py:1.13 PanGalactic/pangalactic/utils/objectreport.py:1.14 --- PanGalactic/pangalactic/utils/objectreport.py:1.13 Tue Jul 13 14:52:09 2004 +++ PanGalactic/pangalactic/utils/objectreport.py Sat Aug 14 19:54:45 2004 @@ -1,28 +1,40 @@ -#!/bin/env python +# $Id: objectreport.py,v 1.14 2004/08/14 23:54:45 waterbug Exp $ +""" +Generator for tabular PDF reports from the grid. -# $Source: /repo/step_testbed/PanGalactic/pangalactic/utils/objectreport.py,v $ +@version: $Revision: 1.14 $ +""" -__version__ = "$Revision: 1.13 $"[11:-2] +__version__ = "$Revision: 1.14 $"[11:-2] import types from reportlab.pdfgen.canvas import Canvas -from reportlab.platypus import SimpleDocTemplate, Spacer, Preformatted, Flowable +from reportlab.platypus import SimpleDocTemplate +from reportlab.platypus import Spacer +from reportlab.platypus import Preformatted +from reportlab.platypus import Flowable from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import inch -from reportlab.lib.styles import PropertySet, getSampleStyleSheet, ParagraphStyle -from reportlab.platypus import Paragraph, Table, TableStyle +from reportlab.lib.styles import PropertySet +from reportlab.lib.styles import getSampleStyleSheet +from reportlab.lib.styles import ParagraphStyle +from reportlab.platypus import Paragraph +from reportlab.platypus import Table +from reportlab.platypus import TableStyle from reportlab.lib import colors -from reportlab.lib.pagesizes import letter, landscape +from reportlab.lib.pagesizes import letter +from reportlab.lib.pagesizes import landscape from pangalactic.utils.pdfreport import PDFReport + class ObjectReport(PDFReport): def __init__(self, filename, objectlist, - title = None, - footer = None, - orientation = "landscape", - tabular = 1, - hidegridlines = 0): + title=None, + footer=None, + orientation="landscape", + tabular=1, + hidegridlines=0): if orientation == "landscape": self.pagesize = landscape(letter) else: @@ -37,18 +49,23 @@ raise TypeError, "objectlist must be a list" PDFReport.__init__(self, self.filename, self.pagesize, - title = title, - footer = footer) - self.table_style = [("LINEABOVE", (0,1), (-1,1), 2, colors.black)] + title=title, + footer=footer) + self.table_style = [("LINEABOVE", + (0,1), (-1,1), 2, colors.black)] if not hidegridlines: self.showGridLines() self.current_config = None + def showGridLines(self): - self.table_style.append(("INNERGRID", (0,0), (-1,-1), 0.55, colors.black)) - self.table_style.append(("BOX",(0,0),(-1,-1), 0.55, colors.black)) + self.table_style.append(("INNERGRID", + (0,0), (-1,-1), 0.55, colors.black)) + self.table_style.append(("BOX", + (0,0), (-1,-1), 0.55, colors.black)) - def getText(self, display_names = None): + + def getText(self, display_names=None): """ Concatenate the text snippets together into a long string. @@ -67,7 +84,8 @@ text += "\n" return text - def GetData(self, total_cols = None): + + def GetData(self, total_cols=None): temp = [] if self.current_config: #print "current_config", self.current_config @@ -105,22 +123,23 @@ else: temp.append(attrlist) return temp - + + def getTable(self, total_cols = None): t = Table(self.GetData(total_cols)) t.hAlign = "LEFT" t.setStyle(self.table_style) return t - - + + def generate(self): - doc = SimpleDocTemplate(self.filename, pagesize = self.pagesize) + doc = SimpleDocTemplate(self.filename, pagesize=self.pagesize) Story = [Spacer(1, 1 * inch)] style = PDFReport.styles["Normal"] if self.tabular: table = self.getTable() - #table._calc(self.PAGE_WIDTH, self.PAGE_HEIGHT) # reportlab > 1.17 - table._calc() # reportlab < 1.18 + # requires reportlab > 1.17 + table._calc(self.PAGE_WIDTH, self.PAGE_HEIGHT) count = 0 trim_table = 0 for col in table._colpositions: @@ -129,12 +148,14 @@ break count +=1 if trim_table: - table = self.getTable(total_cols = count -1) + table = self.getTable(total_cols=count -1) Story.append(table) else: bogustext = self.getText() p = Preformatted(bogustext, style) Story.append(p) - doc.build(Story, onFirstPage=self.reportFirstPage, onLaterPages=self.reportLaterPages) + doc.build(Story, + onFirstPage=self.reportFirstPage, + onLaterPages=self.reportLaterPages) return self.filename - + Index: PanGalactic/pangalactic/utils/userinfo.py diff -u PanGalactic/pangalactic/utils/userinfo.py:1.5 PanGalactic/pangalactic/utils/userinfo.py:1.6 --- PanGalactic/pangalactic/utils/userinfo.py:1.5 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/userinfo.py Sat Aug 14 19:54:45 2004 @@ -83,14 +83,14 @@ elif foo == 1: email = "admin" - new_user = Person(fname = fname, - lname = lname, - mi_or_name = mi_or_name, - email = email, - position_title = position_title, - org_oid = org_oid, - phone = phone, - x500_number = x500_number) + new_user = Person(fname=fname, + lname=lname, + mi_or_name=mi_or_name, + email=email, + position_title=position_title, + org=org_oid, + phone=phone, + x500_number=x500_number) print "new_user", new_user.email return new_user Index: PanGalactic/pangalactic/utils/usersearchgui.py diff -u PanGalactic/pangalactic/utils/usersearchgui.py:1.5 PanGalactic/pangalactic/utils/usersearchgui.py:1.6 --- PanGalactic/pangalactic/utils/usersearchgui.py:1.5 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/usersearchgui.py Sat Aug 14 19:54:45 2004 @@ -13,34 +13,34 @@ def getFirstNameWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_FNAME), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_FNAME), "wxTextCtrl") def getLastNameWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_LNAME), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_LNAME), "wxTextCtrl") def getMiWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_MI), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_MI), "wxTextCtrl") def getEmailWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_EMAIL), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_EMAIL), "wxTextCtrl") def getTitlePosWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_TITLEPOS), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_TITLEPOS), "wxTextCtrl") def getOrgWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_ORG), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_ORG), "wxTextCtrl") def getUseridWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_ID), "wxTextCtrl" ) + return wxPyTypeCast(self.FindWindowById(USER_ID), "wxTextCtrl") def getSearchWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_SEARCH), "wxButton" ) + return wxPyTypeCast(self.FindWindowById(USER_SEARCH), "wxButton") def getClearWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_CLEAR), "wxButton" ) + return wxPyTypeCast(self.FindWindowById(USER_CLEAR), "wxButton") def getCloseWgt(self): - return wxPyTypeCast(self.FindWindowById(USER_CLOSE), "wxButton" ) + return wxPyTypeCast(self.FindWindowById(USER_CLOSE), "wxButton") def clearForm(self): @@ -60,13 +60,20 @@ fields = [] fieldlist = [] - fields.append(("Person", "fname", self.getFirstNameWgt().GetValue())) - fields.append(("Person", "mi_or_name", self.getMiWgt().GetValue())) - fields.append(("Person", "lname", self.getLastNameWgt().GetValue())) - fields.append(("Person", "email", self.getEmailWgt().GetValue())) - fields.append(("Person", "pgef_oid", self.getUseridWgt().GetValue())) - fields.append(("Person", "position_title", self.getTitlePosWgt().GetValue())) - fields.append(("Person", "organization", self.getOrgWgt().GetValue())) + fields.append(("Person", "fname", + self.getFirstNameWgt().GetValue())) + fields.append(("Person", "mi_or_name", + self.getMiWgt().GetValue())) + fields.append(("Person", "lname", + self.getLastNameWgt().GetValue())) + fields.append(("Person", "email", + self.getEmailWgt().GetValue())) + fields.append(("Person", "pgef_oid", + self.getUseridWgt().GetValue())) + fields.append(("Person", "position_title", + self.getTitlePosWgt().GetValue())) + fields.append(("Person", "org", + self.getOrgWgt().GetValue())) # check for any non-empty/non-blank fields for classname, label, field in fields: @@ -82,7 +89,7 @@ for fieldinfo in fieldlist: classname = fieldinfo[0] - attrinfo = fieldinfo[1:] + attrinfo = (fieldinfo[1], 'like', fieldinfo[2]) classattrdict[classname].append(attrinfo) print "classattrdict", classattrdict @@ -92,3 +99,4 @@ del classattrdict[classname] return classattrdict + Index: PanGalactic/pangalactic/utils/xmlrpcinterface.py diff -u PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.69 PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.70 --- PanGalactic/pangalactic/utils/xmlrpcinterface.py:1.69 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/utils/xmlrpcinterface.py Sat Aug 14 19:54:45 2004 @@ -3,10 +3,10 @@ """ PanGalactic Client XML-RPC Interfaces -@version: $Revision: 1.69 $ +@version: $Revision: 1.70 $ """ -__version__ = "$Revision: 1.69 $"[11:-2] +__version__ = "$Revision: 1.70 $"[11:-2] import xmlrpclib import types @@ -270,7 +270,8 @@ that satisfy the (attr, attrvalue) pairs. @type class_attr_dict: dictionary - @param class_attr_dict: looks like {classname:(attrname, attrvalue, comparator),} + @param class_attr_dict: looks like + {classname:(attrname, comparator, attrvalue), ...} """ print "xmlrpcinterface.search", class_attr_dict if localobjs == None: From waterbug at ned.gsfc.nasa.gov Sun Aug 15 01:11:40 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 15 01:11:42 2004 Subject: [Pangalactic-commits] Small oops in ref data. Message-ID: <200408150511.i7F5Bere029411@ned.gsfc.nasa.gov> Modified files: PanGalactic/src/sql/insertRefData.sql 1.12 1.13 Log message: Small oops in ref data. Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.12 PanGalactic/src/sql/insertRefData.sql:1.13 --- PanGalactic/src/sql/insertRefData.sql:1.12 Mon Aug 9 17:55:33 2004 +++ PanGalactic/src/sql/insertRefData.sql Sun Aug 15 01:11:39 2004 @@ -1,6 +1,6 @@ /* PGERDB reference data initialization. */ -/* $Id: insertRefData.sql,v 1.12 2004/08/09 21:55:33 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.13 2004/08/15 05:11:39 waterbug Exp $ */ /* This script sets up the default identification contexts for * PGEF objects, and is required before the PGERDB can be @@ -70,7 +70,7 @@ 'PGER', 'admin', 'admin', - 'FGII', + 'PGANA', '0' ); From waterbug at ned.gsfc.nasa.gov Sun Aug 15 15:58:39 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 15 15:58:41 2004 Subject: [Pangalactic-commits] fnord.py -> pangalaxian.py Message-ID: <200408151958.i7FJwdYS009123@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.iss None 1.1 PanGalactic/pangalactic/client/pangalaxian.py None 1.1 PanGalactic/pangalactic/client/setup.py 1.15 1.16 PanGalactic/pangalactic/client/fnord.iss 1.9 None PanGalactic/pangalactic/client/fnord.py 1.115 None PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.149 1.150 PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py 1.12 1.13 Log message: fnord.py -> pangalaxian.py Index: PanGalactic/pangalactic/client/setup.py diff -u PanGalactic/pangalactic/client/setup.py:1.15 PanGalactic/pangalactic/client/setup.py:1.16 --- PanGalactic/pangalactic/client/setup.py:1.15 Tue May 11 16:58:47 2004 +++ PanGalactic/pangalactic/client/setup.py Sun Aug 15 15:58:37 2004 @@ -3,7 +3,7 @@ #command line invocation: # #new invocation: -#python setup.py py2exe -i "POSException" -d c:\nasa\PanGalactic\pangalactic\client\dist\fnord --ignores "Persistence.Persistent, initgroups, intSet, jarray, java.awt.image, javax.imageio, logger, mxDateTime.__version__, yaml, _rl_accel, Crypto.Cipher, Interface, OpenSSL, java.io.IOException, java.io.InterruptedIOException, java.net, resource, wxPython.lib.PyCrust.version, Crypto.Util" +#python setup.py py2exe -i "POSException" -d c:\nasa\PanGalactic\pangalactic\client\dist\pangalaxian --ignores "Persistence.Persistent, initgroups, intSet, jarray, java.awt.image, javax.imageio, logger, mxDateTime.__version__, yaml, _rl_accel, Crypto.Cipher, Interface, OpenSSL, java.io.IOException, java.io.InterruptedIOException, java.net, resource, wxPython.lib.PyCrust.version, Crypto.Util" from distutils.core import setup import py2exe @@ -25,7 +25,7 @@ sys.path.append (os.path.join (os.getcwd(), 'modules', 'dm')) setup(name="Pan-Galactic PGEF", - console=["fnord.py"], + console=["pangalaxian.py"], packages=["reportlab", "ZODB", "PIL", "xml", "PyCrust"], data_files=[("io", ["io/gidep_problem_advisory_layout.pgef", "io/nasa_advisory_layout.pgef", "io/problem_impact_statement_layout.pgef"]), ("images", ["images/pangalacticon.png"])]) Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.149 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.150 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.149 Fri Aug 13 03:27:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Sun Aug 15 15:58:37 2004 @@ -1,14 +1,14 @@ -# $Id: itemeditframe.py,v 1.149 2004/08/13 07:27:29 waterbug Exp $ +# $Id: itemeditframe.py,v 1.150 2004/08/15 19:58:37 waterbug Exp $ -__version__ = "$Revision: 1.149 $"[11:-2] +__version__ = "$Revision: 1.150 $"[11:-2] import copy import types from wxPython.wx import * -from pangalactic.client.dataobjects import partslistinfo -from pangalactic.client.dataobjects import partslistmap +from pangalactic.client.dataobjects import partslistinfo +from pangalactic.client.dataobjects import partslistmap from pangalactic.client.modules.psm import docform from pangalactic.client.modules.psm import partslistform from pangalactic.client.modules.psm import partslistview Index: PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py diff -u PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.12 PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.13 --- PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.12 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py Sun Aug 15 15:58:38 2004 @@ -12,7 +12,7 @@ #wxHORIZONTAL, True, True) #sizer.AddWindow(tmppanel,0,wxALIGN_LEFT) #sizer.AddSpacer(20,20,wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5) - + tmppanel2 = wxPanel(self, -1) TopPanelFunc(tmppanel2, True,True) sizer.AddWindow(tmppanel2,0,wxALIGN_RIGHT) @@ -24,22 +24,22 @@ self.itemlist = [] self.itemlabel = "Select a Product Model" # WDR: handler declarations for ItemSearchForm - + # WDR: methods for ItemSearchForm def GetProjectWidget(self): """Returns a handle to the Project Choicebox""" return wxPyTypeCast(self.FindWindowById(ID_PROJECT), "wxChoice") - + def GetItemWidget(self): """Returns a handle to the Product Model Combobox""" return wxPyTypeCast(self.FindWindowById(ID_ITEM), "wxChoice") - + # def GetButtonTopLevel(self): # return wxPyTypeCast(self.FindWindowById(TOPLEVELITEMS_BUTTON), "wxButton") # refactor this? - def FillProjectWidget(self, ProjectList, projectlabel = None): + def FillProjectWidget(self, ProjectList, projectlabel=None): """Fills the Project combo box, assumes that the project list is passed in""" #print "toolbarpanel.fillprojectwgt" widget = self.GetProjectWidget() @@ -49,7 +49,7 @@ if len(projectlist) == 0: widget.Enable(False) return - + projectlist.sort() if projectlabel: widget.Append(projectlabel) @@ -60,8 +60,8 @@ widget.Enable(True) widget.SetSelection(0) self.projectlist = ProjectList - - + + def FillItemWidget(self, itemlist, itemlabel = None): """Fills the item combobox from a list of passed in item name/obj pairs""" widget = self.GetItemWidget() From waterbug at ned.gsfc.nasa.gov Sun Aug 15 17:51:03 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 15 17:51:06 2004 Subject: [Pangalactic-commits] Mostly mods regarding prefs, state, projects. Message-ID: <200408152151.i7FLp3p7009404@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.1 1.2 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.175 1.176 PanGalactic/pangalactic/utils/datamanager.py 1.143 1.144 PanGalactic/src/sql/insertRefData.sql 1.13 1.14 Log message: Mostly mods regarding prefs, state, projects. Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.13 PanGalactic/src/sql/insertRefData.sql:1.14 --- PanGalactic/src/sql/insertRefData.sql:1.13 Sun Aug 15 01:11:39 2004 +++ PanGalactic/src/sql/insertRefData.sql Sun Aug 15 17:51:01 2004 @@ -1,6 +1,6 @@ /* PGERDB reference data initialization. */ -/* $Id: insertRefData.sql,v 1.13 2004/08/15 05:11:39 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.14 2004/08/15 21:51:01 waterbug Exp $ */ /* This script sets up the default identification contexts for * PGEF objects, and is required before the PGERDB can be @@ -247,14 +247,14 @@ ) VALUES ( - 'NOPROJECT', + 'NoProject', 'Project', - 'NOPROJECT', + 'NoProject', 'PGER', 'admin', 'admin', - 'Ni', - 'No project specified' + '(no project)', + 'A project for things that have no project' ); END; Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.1 PanGalactic/pangalactic/client/pangalaxian.py:1.2 --- PanGalactic/pangalactic/client/pangalaxian.py:1.1 Sun Aug 15 15:58:37 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Sun Aug 15 17:51:00 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.1 2004/08/15 19:58:37 waterbug Exp $ +# $Id: pangalaxian.py,v 1.2 2004/08/15 21:51:00 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -106,14 +106,16 @@ ID_PREF_SHOWLOGINCONFIRMED = wxNewId() ID_HORIZONTAL_SASH = wxNewId() -PGEF_TITLE = "Pan-Galactic PGEF (PGEF)" +PGEF_TITLE = "Pan Galactic Engineering Framework (PGEF)" PRODUCT_TYPES = {ID_FILE_NEWPART : "Part", ID_FILE_NEWMODEL : "Model"} class CustomStatusBar(wxStatusBar): - """ This method created the statusbar that is used on the main form """ + """ + The custom statusbar that is used on the main PanGalaxian window. + """ def __init__(self, parent): wxStatusBar.__init__(self, parent, -1) self.SetFieldsCount(3) @@ -175,7 +177,9 @@ class MainFrame(wxFrame): - """This class encapsulates the main client window""" + """ + The main PanGalaxian window + """ def __init__(self, parent, ID, title, pos, size): wxFrame.__init__(self, parent, ID, title,pos, size) @@ -209,7 +213,7 @@ self.BuildDate = BUILD_DATE self.Version = VERSION self.HelpTitle = "About " + self.AppTitle - self.HelpText = "This is the Pan-Galactic Engineering Framework.\n\n" + \ + self.HelpText = "This is the Pan Galactic Engineering Framework.\n\n" + \ "Help TBD RSN" EVT_SIZE(self, self.OnSize) @@ -292,18 +296,17 @@ useroid = prefs.get('email', None) or prefs.get('userid', 'newbie') - print 'fnord: useroid =', useroid + print 'pangalaxian: useroid =', useroid self.user = Person(pgef_oid=useroid, id=prefs.get('userid', useroid), email=prefs.get('email', 'local')) - print 'fnord: user =' - print self.user + print 'pangalaxian: user =', self.user.id oid.setOidBase(useroid) - state['currentprojectname'] = prefs.get('lastproject', + state['currentprojectname'] = state.get('lastproject', None) or prefs.get( 'defaultproject', 'NOPROJECT') - print 'fnord: current project =', state['currentprojectname'] + print 'pangalaxian: current project =', state['currentprojectname'] self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=state['currentprojectname']) @@ -446,7 +449,7 @@ self.psmtool.ExportProperties() def OnServerCombo(self, event=None): - print "fnord.OnServerCombo, state =", state + print "pangalaxian.OnServerCombo, state =", state print " - prefs =", prefs print " - state =", state if not state['loggedin']: @@ -463,12 +466,12 @@ self.psmtool.OnSearchItems() def OnNewPart(self, event): - #print "psmtool.onnewpart" + # print "psmtool.onnewpart" metadata = ["MENU", None, "Part"] self.psmtool.OnNewPart(metadata) def OnNewModel(self, event): - #print "psmtool.onnewmodel" + # print "psmtool.onnewmodel" metadata = ["MENU", None, "Model"] self.psmtool.OnNewModel(metadata) @@ -516,7 +519,7 @@ event.Skip() def OnEnableTooltips(self, event): - print "fnord.enable_tooltips" + print "pangalaxian.enable_tooltips" id = event.GetId() checked = self.menuBar.FindItemById(id).IsChecked() if checked: @@ -596,17 +599,17 @@ dlg.CentreOnParent() login_passwd = self.dm.getPasswd("login") curr_passwd = self.dm.getPasswd("current") - #print "passwd", login_passwd, curr_passwd + # print "passwd", login_passwd, curr_passwd still_trying = True while still_trying: - #print dlg.GetTitle() + # print dlg.GetTitle() if dlg.ShowModal() == wxID_OK: - #print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() + # print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() if dlg.getOldPasswd() == curr_passwd and \ dlg.getNewPasswd() == dlg.getConfirmPasswd(): - #print "changed" + # print "changed" still_trying = False new_password = dlg.getConfirmPasswd() self.dm.changePassword(login_passwd, @@ -625,12 +628,12 @@ dlg.CentreOnParent() still_trying = True while still_trying: - #print dlg.GetTitle() + # print dlg.GetTitle() if dlg.ShowModal() == wxID_OK: - #print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() + # print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() if dlg.getNewPasswd() == dlg.getConfirmPasswd(): - #print "changed" + # print "changed" still_trying = False new_password = dlg.getConfirmPasswd() self.dm.changePassword(new_password, @@ -664,14 +667,14 @@ ## def onPasswd(self, event): ## login_passwd = self.dm.getPasswd("login") ## curr_passwd = self.dm.getPasswd("current") -## #print "passwd", login_passwd, curr_passwd +## # print "passwd", login_passwd, curr_passwd ## dlg = ChangePasswd(self, -1, "Change Password") ## dlg.CentreOnParent() ## still_trying = True ## while still_trying: ## if dlg.ShowModal() == wxID_OK: -## #print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() +## # print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() ## if dlg.getOldPasswd() == curr_passwd and \ ## dlg.getNewPasswd() == dlg.getConfirmPasswd(): @@ -782,7 +785,7 @@ def OnDBBrowser(self, event): - #print "fnord.ondbbrowser" + # print "pangalaxian.ondbbrowser" tmpsize = wxSize(750, 500) dbb_frame = toolframe.toolFrame(self, -1, 'Local Database Browser', wxDefaultPosition, tmpsize) @@ -823,7 +826,7 @@ def Commit(self, event): - print "fnord.commit" + print "pangalaxian.commit" objlist = self.dm.getUncommittedObjs() self.psmtool.Commit(closing = False, objectlist = objlist, dont_ask = False) @@ -856,13 +859,13 @@ def addSpecialMenus(self, user_info): if self.dm.user.god: self.AddGodMenu(self.dm.user) - elif self.dm.user.id == "admin": #admin_flag: + elif self.dm.user.id == "admin": # admin_flag: self.AddAdminMenu(self.dm.user) def removeSpecialMenus(self, user_info): - if self.AdminMenu: #userinfo.id == "admin" and self.AdminMenu: #admin_flag and self.AdminMenu: + if self.AdminMenu: # userinfo.id == "admin" and self.AdminMenu: #admin_flag and self.AdminMenu: self.RemoveAdminMenu(user_info) - elif self.GodMenu: #userinfo.god and self.GodMenu: + elif self.GodMenu: # userinfo.god and self.GodMenu: self.RemoveGodMenu() def RemoveAdminMenu(self, user_info): @@ -925,7 +928,7 @@ def OnLogin(self, event): - print "fnord.OnLogin" + print "pangalaxian.OnLogin" state['loggedin'] = '1' loginconfirm = prefs.get('ShowLoginConfirmed', None) dialog = LoginClass(self, -1, "PGEF Login" ) @@ -1009,14 +1012,14 @@ dialog.Destroy() still_trying = False if prefs.get('ShowLoginConfirmed', None): - if state.get('currentprojectname', None): - sdlg = wxMessageDialog(self, - "Login successful.", - "Yay!", wxOK) + sdlg = wxMessageDialog(self, + "Login successful.", + "Yay!", wxOK) + if (not state.get('currentprojectname', None) and + prefs.get('project', None)): + state['currentprojectname'] = prefs['project'] else: - sdlg = wxMessageDialog(self, - "Login successful. Select a project.", - "Yay", wxOK) + state['currentprojectname'] = 'NoProject' sdlg.CentreOnParent() sdlg.ShowModal() sdlg.Destroy() @@ -1026,19 +1029,18 @@ def OnClose(self, event): """ - OnClose method that handles all the work that is required before we - can successfully close down the application. + OnClose method that handles all the work that is required before + PanGalaxian can exit. """ - # since we call close from inside this method, we use the guard - # variable self.Closing to skip the event if we are already working - # on closing down. + # Since close is called from inside this method, the guard variable + # self.Closing skips the event if shut down is already in progress. if self.Closing: event.Skip() else: writePrefs() writeState() if not self.WorkInProgress: - #clean up the [tsv, properties, xls] files in the tmp directory + # clean up the [tsv, properties, xls] files in the tmp directory tmpfiles = os.listdir(os.path.join(workingdir, "tmp")) for ndx in range(len(tmpfiles)): if (tmpfiles[ndx].endswith("tsv") or @@ -1068,7 +1070,7 @@ dlg.Destroy() def ActivateTool(self): - print "fnord.ActivateTool, state =", state + print "pangalaxian.ActivateTool, state =", state if self.psmtool and self.psmtool.IsShown(): return @@ -1086,7 +1088,7 @@ def InitializeTool(self): - #print "fnord.initializetool", self.State + # print "pangalaxian.initializetool", self.State tbh = self.GetToolBar().GetSizeTuple()[1] pos = wxPoint (0, tbh) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.175 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.176 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.175 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Sun Aug 15 17:51:01 2004 @@ -6,10 +6,11 @@ # Copyright: #---------------------------------------------------------------------------- """ -This module is the main application code for the pgef client interface +PSM Tool is the Product Structure Manager. It handles visualization, +navigation, and editing of product structures. """ -__version__ = "$Revision: 1.175 $"[11:-2] +__version__ = "$Revision: 1.176 $"[11:-2] import os @@ -45,7 +46,7 @@ from pangalactic.utils import ToolkitImages from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -import pangalactic.utils.basegrid as basegrid +from pangalactic.utils import basegrid from pangalactic.client.support import httpdownload from pangalactic.client.modules.psm import toolbarpanel @@ -63,7 +64,7 @@ try: # this imports are for ExportProperties - import pangalactic.client.modules.psm.partslistview as partslistview + from pangalactic.client.modules.psm import partslistview from pangalactic.client.modules.plm.ms2file import Data2MS CAN_EXPORT_PROPERTIES = True @@ -91,15 +92,16 @@ # this is the order of the notebook pages (grids) GRIDLIST = ["Part", "Model"] -prefs = prefs -CurrentProjectName = "" def CreateTool(parent, datamgr, ID, pos): return PSMTool(parent, datamgr, ID, pos, wxSize(1,1)) class PSMTool(wxPanel, Security_Mixin): - '''This class encapsulates the main client window''' + """ + PSM Tool is the Product Structure Manager. It handles visualization, + navigation, and editing of product structures. + """ ID_WINDOW_TOP = wxNewId() ID_WINDOW_LEFT = wxNewId() @@ -128,10 +130,10 @@ self.modelgrid = basegrid.BaseGrid(self.grid_notebook, -1, classname = "Model", localdb = self.dm.localDB) - grid_tooltip = "A tabular display of the data in the models " + \ - "of the currently selected project.\n" + \ - "Doubleclick on a part to display the Model Editor.\n" + \ - "Press to drag a Model into the hierarchy." + grid_tooltip = """A tabular display of the data in the models +of the currently selected project. +Doubleclick on a part to display the Model Editor. +Press to drag a Model into the hierarchy.""" self.modelgrid.GetGridWindow().SetToolTip(wxToolTip(grid_tooltip)) self.modelgrid.EnableEditing(False) self.modelgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, @@ -147,10 +149,10 @@ self.itemgrid = basegrid.BaseGrid(self.grid_notebook, -1, classname = "Part", localdb = self.dm.localDB) - grid_tooltip = "A tabular display of the data in the parts " + \ - "of the currently selected project.\n" + \ - "Doubleclick on a part to display the Part Editor.\n" + \ - "Press to drag a Part into the hierarchy." + grid_tooltip = """A tabular display of the data in the parts +of the currently selected project. +Doubleclick on a part to display the Part Editor. +Press to drag a Part into the hierarchy.""" self.itemgrid.GetGridWindow().SetToolTip(wxToolTip(grid_tooltip)) self.itemgrid.EnableEditing(False) self.itemgrid.RightClickMenuOptions = [(basegrid.ID_POPUP_EDIT, @@ -169,12 +171,13 @@ rootObject = self.Parent, rootIsNamespace = 1) win.SplitHorizontally(shellWin, fillingWin) - grid_tooltip = "This is a shell window for debugging.\n" + \ - "You're on your own." + grid_tooltip = """ +This is a shell window for debugging. +You're on your own.""" win.SetToolTip(wxToolTip(grid_tooltip)) self.grid_notebook.AddPage(win, "PyCrust") # Create some layout windows - # A window like a toolbar + # First, a toolbar win = wxSashLayoutWindow(self, self.ID_WINDOW_TOP, wxDefaultPosition, @@ -200,7 +203,7 @@ win.SetSashVisible(wxSASH_RIGHT, True) self.leftPanel = wxPanel(win, ID_LEFT_PANEL) hbox = wxBoxSizer(wxVERTICAL) - choice_list = ["Default", "Requirements", "Functions", "Simulations"] + choice_list = ["Physical Design", "Requirements", "Functions", "Simulations"] self.view = wxChoice(self.leftPanel, ID_CHOICE_VIEW, wxPoint(90, 50), @@ -217,18 +220,18 @@ self.tID, self.dm) self.tree.SetBackgroundColour(wxWHITE) - tree_tooltip = "A hierarchy of the currently selected part.\n" + \ - "Click on a part to highlight its data in the Parts grid.\n" + \ - "Doubleclick on a part to display the Part Editor." + tree_tooltip = """A hierarchy of the currently selected part. +Click on a part to highlight its data in the Parts grid. +Doubleclick on a part to display the Part Editor.""" self.tree.SetToolTip(wxToolTip(tree_tooltip)) self.tree_notebook.AddPage(self.tree, 'Assembly') self.version_tree_ID = wxNewId() self.version_tree = pgefversiontree.PgefVersionTree(self.tree_notebook, self.version_tree_ID, self.dm) - tree_tooltip = "A hierarchy of the currently selected part.\n" + \ - "Click on a part to highlight its data in the Parts grid.\n" + \ - "Doubleclick on a part to display the Part Editor." + tree_tooltip = """A hierarchy of the currently selected part. +Click on a part to highlight its data in the Parts grid. +Doubleclick on a part to display the Part Editor.""" self.version_tree.SetToolTip(wxToolTip(tree_tooltip)) self.tree_notebook.AddPage(self.version_tree, 'Version') hbox.Add(self.tree_notebook, 1, wxEXPAND) @@ -735,7 +738,7 @@ print "psmtool.updateforlogin" if state['loggedin']: self.topWindow.toppanel.FillProjectWidget(self.dm.projects, - "Select a Project") + "NoProject") wgt = self.topWindow.toppanel.GetItemWidget() wgt.SetSelection(0) self.tree.DeleteAllItems() @@ -946,7 +949,7 @@ # print "project ndx", projectname, ndx if self.itemeditform: self.itemeditform.SecureMode() - prefs['lastproject'] = projectname + state['lastproject'] = projectname wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) dlg = None Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.143 PanGalactic/pangalactic/utils/datamanager.py:1.144 --- PanGalactic/pangalactic/utils/datamanager.py:1.143 Sat Aug 14 19:54:45 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Sun Aug 15 17:51:01 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.143 $ +@version: $Revision: 1.144 $ """ -__version__ = "$Revision: 1.143 $"[11:-2] +__version__ = "$Revision: 1.144 $"[11:-2] import time import mx.DateTime @@ -109,7 +109,7 @@ def getRoot(self): return self.localDB.dbroot - + def getPasswd(self, pwd_id): return self.localDB.getPasswd(pwd_id) @@ -140,7 +140,7 @@ else: print "dm.getdisplaymap: no entry for:", mapname, "wha' happened?" return {} - + def getDisplayConfig(self): return self.localDB.getDisplayConfig() @@ -154,14 +154,11 @@ def getRoles(self): return self.localDB.getDict(self.localDB.ROLE) - + def saveRoles(self, roles): # print "dm.saveroles" self.localDB.SaveRoles(roles) - def getUsers(self): - return self.localDB.getDict(self.localDB.USER) - def getUser(self, userid): return self.localDB.getUser(self.localDB.USER, userid) @@ -178,17 +175,18 @@ e = "PgefFile should not be initialized here. Use newPgefFile." raise ValueError, e obj = None - if classname in ["Part", "Model", "Document", "PartsList"]: + if classname in ["VersionedObject", "Part", "Model", "Document", + "PartsList"]: klass = self._registry.pgef_classes[classname] - obj = klass(id = "NEW", - id_context = self.CurrentProject.id_context, - project = self.CurrentProject) + obj = klass(id="NEW", + id_context=self.CurrentProject.id_context, + project=state['currentprojectname']) obj.initObject(self.CurrentProject.id, self.user.id) return obj - def newPgefFile(self, parentobj, filename = None, drole = "", - dlabel = "", mime_type = "text/plain", dsequence = -1): + def newPgefFile(self, parentobj, filename=None, drole="", + dlabel="", mime_type="text/plain", dsequence=-1): classname = parentobj.__class__.__name__ if not filename: filename = parentobj._upload_file_name @@ -213,29 +211,6 @@ obj.initObject(self.CurrentProject.id, self.user.id) obj.setLocalFilename(filename) return obj - - - def setCurrentProject(self, projectname): - """ - Set the current project context, which will be used for all new - objects that have a 'project' attribute. - """ - # print "datamanager.setcurrentproject", projectname - self.CurrentProject = None - allprojects = self.localDB.getDict(self.localDB.PROJECT) - for k, p in allprojects.items(): - if p.id == projectname: - self.CurrentProject = p - - if self.CurrentProject: - print "Aha. Project", self.CurrentProject.id - else: - print "Rats! No Project. Faking it." - # might as well make it the official "null" project ... - self.CurrentProject = Project(pgef_oid='NOPROJECT', - id='NOPROJECT', - name='Ni', - description='No project specified') def login(self, username, password, secure=1): @@ -263,7 +238,7 @@ tmp_role.id = username tmp_role.project = 'H2G2' tmp_roles.append(tmp_role) - + self.setRoles(tmp_roles) user2save = Person() user2save = copy.deepcopy(self.watchdog.user) @@ -310,7 +285,7 @@ objs=None) # print "docs", docs # do we need to connect docs with parts/models? - + fieldnames = {"project" : projectlist[0]} parts = self.server.getObjects("Part", fields=fieldnames, @@ -378,7 +353,7 @@ objlist = [] return objlist return objdict.values() - + def add(self, addlist): self.localDB.add(addlist) @@ -401,31 +376,61 @@ def packLocalDB(self): self.localDB.Pack() - - def getProjects(self): + + def getProjects(self, id_context='TEST'): """ - Get the projects from the repository; save them locally, and return - them as a list. + Get a list of projects from the repository; save them locally, and + return them as a list. """ - if self.server: - print "NOTE: project.id_context is TEST" - fieldnames = {"id_context" : "TEST"} + if state['loggedin'] and self.server: + print "NOTE: default project.id_context is TEST (for now)" + fielddict = {"id_context" : id_context} projs = self.server.getObjects("Project", - fields = fieldnames, - refs = 1, subtypes = 0, - objs = None) - print "found", len(projs), "TEST projects" + fields=fielddict, + refs=1, subtypes=0, + objs=None) + print 'found %s projects in context "%s"' % ( + len(projs), id_context) if len(projs): print 'they are:' for p in projs: print p.id else: - print 'no projects found' + print 'no projects found in context "%s"' % (id_context) self.localDB.save(projs) - self.projects = self.localDB.getDict(self.localDB.PROJECT) return self.projects - + + + def setCurrentProject(self, projectname): + """ + Set the current project, which will be used for all new objects + that have a 'project' attribute. + """ + # print "datamanager.setcurrentproject", projectname + self.CurrentProject = None + allprojects = self.localDB.getDict(self.localDB.PROJECT) + for k, p in allprojects.items(): + if p.id == projectname: + self.CurrentProject = p + if not self.CurrentProject and state['loggedin']: + fielddict = {"pgef_oid":projectname} + p = self.server.getObjects('Project', + fields=fielddict, + refs=1, + subtypes=0, + objs=None) + self.CurrentProject = p + if self.CurrentProject: + print "Aha. Project", self.CurrentProject.id + else: + print "Rats! No Project. Faking it." + # might as well make it the official "null" project ... + self.CurrentProject = Project(pgef_oid='NOPROJECT', + id='NOPROJECT', + name='Ni', + description='No project specified') + def getLookupObject(self, pgef_oid): # print "datamanager.getLookupObject", pgef_oid @@ -437,7 +442,7 @@ return obj - + def getLocalAcus(self, currentproject = None): return self.localDB.GetLocalAcus(currentproject) @@ -457,8 +462,8 @@ keydict = {"assembly" : tmp_obj.pgef_oid} objlist = self.server.getLinkedObjs("Acu", keydict, project_objs) return objlist - - + + def getNAUOByAssemblyID(self, assemblyIds): """ Retrieves all of the Acus associated with a list of assembly ids. @@ -472,11 +477,11 @@ temp_obj = self.localDB.getLookupObject(id) if not temp_obj: return - + objlist = self.getLinkedObjsByAcu(temp_obj) if not objlist: return [] - + nauoobjs = [] itemobjs = [] modelobjs = [] @@ -504,12 +509,12 @@ # add the nauos to the projectobject dictionary in localdb self.localDB.addProjectObjects(self.CurrentProject.id, nauoobjs) - + if len(itemobjs) > 0: self.localDB.save(itemobjs) - + break # only do the first one for now - + for obj in objlist: classname = obj.__class__.__name__ if classname in ["Acu", "Part", "Model"]: @@ -533,7 +538,7 @@ def getParts(self): return self.localDB.getDict(self.localDB.PART) - + def getLocalPartsLists(self): return self.localDB.GetPartsLists() @@ -545,13 +550,13 @@ def getGeneralDocuments(self): return self.localDB.GetGeneralDocuments() - + def getDocPartLinks(self): return self.localDB.getDict(self.localDB.DOCPTREL) def getPartDocLinksByProjectId(self, project_id): return self.localDB.GetLocalPartDocLinks(project_id) - + def getPartDocLinksByPartId(self, idlist): """Retrieves all of the DocPtRels associated with a Part ID""" # print "datamanager.getpartdoclinkbypartid" @@ -568,7 +573,7 @@ itemobjs = [] partslistobjs = [] documentobjs = [] - + for obj in objlist: if obj.isEmpty(): continue @@ -591,13 +596,13 @@ if len(partslistobjs) > 0: self.localDB.save(partslistobjs) - + if len(documentobjs) > 0: self.localDB.save(documentobjs) - + if len(pdrobjs) > 0: self.localDB.save(pdrobjs) - + if len(pdrids) > 0: self.pdrIDs[id] = pdrids self.localDB.dbroot['DocPtRelIds'][id] = pdrids @@ -638,7 +643,7 @@ del self.nauoIDs[ACUobj.pgef_oid] except: parent_ids = self.nauoIDs['ROOT'] - + for acus in self.nauoIDs.keys(): temp = self.nauoIDs[acus] for key, value in temp.items(): @@ -647,15 +652,15 @@ del value[ndx] self.nauoIDs[acus] = temp - + def clearNauoIDs(self): self.nauoIDs.clear() - + def uncommittedData(self): # print "datamanager.uncommitteddata" if not self.CurrentProject: return False - + allprojectobjs = self.localDB.GetProjectObjects() if allprojectobjs.has_key(self.CurrentProject.id): projectobjs = allprojectobjs[self.CurrentProject.id] @@ -739,7 +744,7 @@ server = self._createServer("anon", "anon") server.requestUser(user_info) - + def search(self, classattrdict): # print "datamanager.search", classattrdict objs_to_hookup = self.localDB.getCommittedObjects() @@ -761,7 +766,7 @@ else: objdict = self.localDB.getOrganizations("TEST") self.searchresults = objdict.values() - + def getSearchResults(self): # print "datamanager.getsearchresults" @@ -771,11 +776,11 @@ def getUncommittedWorkflows(self): return self.localDB.getUncommittedWorkflows() - + def getUncommittedWfObjects(self): return self.localDB.getUncommittedWfObjects() - + def getWorkflows(self, attrlist = None): # print "datamanager.getworkflows" if state['loggedin']: @@ -817,7 +822,7 @@ templatedict = self.getWfProcessTemplates() return templatedict[template_oid] - + def getWfProcessTemplates(self): # print "datamanager.getWfProcessTemplates" templatedict = self.localDB.GetLocalWorkflowTemplates() @@ -830,7 +835,7 @@ self.localDB.SaveWfProcessTemplate([wfobj], recurse = True) wfobjdict[wfobj.pgef_oid] = wfobj return wfobjdict - + def _uploadFile(self, obj_oid, file_name): if os.path.exists(file_name): @@ -857,12 +862,12 @@ else: print "UploadError:", file_name + "does not exist" - + def uploadFile(self, obj): print "datamanager.uploadfile", obj.id, obj._local_file_name self._uploadFile(obj.pgef_oid, obj._local_file_name) - + def commit(self, unsavedobjs): print "datamanager.commit" if state['loggedin']: @@ -904,7 +909,7 @@ objs_to_hookup = self.localDB.getCommittedObjects().values() objs_to_hookup.append(self.CurrentProject) retval = self.server.addObjects(addlist, objs_to_hookup) - + if retval: for obj in addlist: obj.state = None @@ -914,10 +919,10 @@ if classname == "PgefFile": self.uploadFile(obj) - + else: print "Commit to database failed - AddObjects" - + # if len(dellist) > 0: # print "datamanager.commit.delete is TBD?" # retval = self.server.CallServerFunction(dellist, "DelObjects", self.auth) @@ -937,7 +942,7 @@ else: print "nothing to save" - + else: print "not logged in" self.localDB.add(unsavedobjs) @@ -986,7 +991,7 @@ local_info = attrinfo return (server_info, local_info) - + def getFiles(self, obj_list): # print "dm.getfiles", obj_list From waterbug at ned.gsfc.nasa.gov Mon Aug 16 06:14:21 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 16 06:14:26 2004 Subject: [Pangalactic-commits] Mainly PSMTool.[SetupForLocalMode, SetupForLogin] -> PSMTool.onModeChange. Message-ID: <200408161014.i7GAELou012373@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.2 1.3 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.150 1.151 PanGalactic/pangalactic/client/modules/psm/projectframe.py 1.10 1.11 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.176 1.177 PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py 1.13 1.14 PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py 1.7 1.8 PanGalactic/pangalactic/enterprise/pgefobject.py 1.66 1.67 PanGalactic/pangalactic/enterprise/project.py 1.25 1.26 PanGalactic/pangalactic/enterprise/versionedobject.py 1.15 1.16 PanGalactic/pangalactic/utils/datamanager.py 1.144 1.145 PanGalactic/pangalactic/utils/localdb.py 1.106 1.107 Log message: Mainly PSMTool.[SetupForLocalMode,SetupForLogin] -> PSMTool.onModeChange. Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.106 PanGalactic/pangalactic/utils/localdb.py:1.107 --- PanGalactic/pangalactic/utils/localdb.py:1.106 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/utils/localdb.py Mon Aug 16 06:14:19 2004 @@ -684,7 +684,7 @@ print "localdb.Save() will be deprecated. use localdb.save() instead." self.save(unsavedlist, override) - def save(self, unsavedlist, override = False): + def save(self, unsavedlist, override=False): #print "localdb.save" retlist = [] if unsavedlist: Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.150 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.151 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.150 Sun Aug 15 15:58:37 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Mon Aug 16 06:14:18 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.150 2004/08/15 19:58:37 waterbug Exp $ +# $Id: itemeditframe.py,v 1.151 2004/08/16 10:14:18 waterbug Exp $ -__version__ = "$Revision: 1.150 $"[11:-2] +__version__ = "$Revision: 1.151 $"[11:-2] import copy import types @@ -989,7 +989,7 @@ self.DiscardChanges() dlg.Destroy() -# self.Parent.GetPSMTool().RebuildMainTree() +# self.Parent.GetPSMTool().rebuildMainTree() self.dm.creatingPartsList = False self.dm.creatingPart = False self.dm.creatingModel = False @@ -1422,7 +1422,7 @@ self.currentform.GetNewWgt().SetFocus() self.dm.refresh = True -# self.Parent.GetPSMTool().RebuildMainTree() +# self.Parent.GetPSMTool().rebuildMainTree() self.editingtab = None Index: PanGalactic/pangalactic/client/modules/psm/projectframe.py diff -u PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.10 PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.11 --- PanGalactic/pangalactic/client/modules/psm/projectframe.py:1.10 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/client/modules/psm/projectframe.py Mon Aug 16 06:14:18 2004 @@ -1,3 +1,12 @@ +# $Id: projectframe.py,v 1.11 2004/08/16 10:14:18 waterbug Exp $ + +""" +Window for editing data about a Project. + +@version: $Revision: 1.11 $ +""" +__version__ = "$Revision: 1.11 $"[11:-2] + from wxPython.wx import EVT_CLOSE, wxDefaultSize, wxDefaultPosition from projectinfo_wdr import * @@ -5,7 +14,9 @@ from pangalactic.utils.pgefstate import state class ProjectFrame(toolframe.toolFrame): - + """ + Window for editing data about a Project. + """ def __init__(self, parent, project, datamanager): toolframe.toolFrame.__init__(self, parent, -1, "Project: ", wxDefaultPosition, wxSize(300, 250)) @@ -21,6 +32,7 @@ EVT_CLOSE(self, self.OnClose) self.Setup(project) + def Setup(self, project): print "projectframe.setup" self.GetCodeWgt().SetValue(project) @@ -41,10 +53,12 @@ self.GetNameWgt().SetValue(self.ProjectInfo["name"]) self.GetCenterWgt().SetValue(self.ProjectInfo["center"]) + def OnClose(self, event): print "projectframe.close" self.Show(False) + def GetCodeWgt(self): return wxPyTypeCast(self.FindWindowById(PROJCODE_TEXTCTRL), "wxTextCtrl" ) @@ -56,3 +70,4 @@ def GetCenterWgt(self): return wxPyTypeCast(self.FindWindowById(PROJCENTER_TEXTCTRL), "wxTextCtrl" ) + Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.66 PanGalactic/pangalactic/enterprise/pgefobject.py:1.67 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.66 Wed Aug 11 02:21:09 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Mon Aug 16 06:14:18 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.66 2004/08/11 06:21:09 waterbug Exp $ +# $Id: pgefobject.py,v 1.67 2004/08/16 10:14:18 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.66 $ +@version: $Revision: 1.67 $ """ -__version__ = "$Revision: 1.66 $"[11:-2] +__version__ = "$Revision: 1.67 $"[11:-2] import types import string @@ -191,7 +191,6 @@ id_context='PanGalactic', name='Description', pgef_datatype='str', - default_display='True', description=""" [rdf:Description] A narrative about the characteristics and identifying features of the object. @@ -287,7 +286,6 @@ name='Creator', pgef_datatype='Person', property_type='object', - default_display='True', description=""" [pgef:creator] The person who created the object. """), @@ -296,7 +294,6 @@ id_context='PanGalactic', name='Created', pgef_datatype='DateTime', - default_display='True', description=""" [pgef:create_datetime] Date-time of creation of the object. """), Index: PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py diff -u PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py:1.7 PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py:1.8 --- PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py:1.7 Tue Mar 16 16:50:38 2004 +++ PanGalactic/pangalactic/client/modules/psm/toolpanel_wdr.py Mon Aug 16 06:14:18 2004 @@ -24,7 +24,7 @@ item0.AddWindow( item1, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5 ) item2 = wxChoice( parent, ID_PROJECT, wxDefaultPosition, wxSize(200,-1), - ["Select a project","","","","",""] , 0 ) + ["","","","",""] , 0 ) item2.SetForegroundColour( wxWHITE ) item2.SetBackgroundColour( wxBLUE ) item2.SetFont( wxFont( 12, wxDEFAULT, wxNORMAL, wxBOLD ) ) Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.2 PanGalactic/pangalactic/client/pangalaxian.py:1.3 --- PanGalactic/pangalactic/client/pangalaxian.py:1.2 Sun Aug 15 17:51:00 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Mon Aug 16 06:14:17 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.2 2004/08/15 21:51:00 waterbug Exp $ +# $Id: pangalaxian.py,v 1.3 2004/08/16 10:14:17 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.2 $ +@version: $Revision: 1.3 $ """ -__version__ = "$Revision: 1.2 $"[11:-2] +__version__ = "$Revision: 1.3 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -106,7 +106,7 @@ ID_PREF_SHOWLOGINCONFIRMED = wxNewId() ID_HORIZONTAL_SASH = wxNewId() -PGEF_TITLE = "Pan Galactic Engineering Framework (PGEF)" +PGEF_TITLE = "PanGalaxian: to infinity ... and beyond!" PRODUCT_TYPES = {ID_FILE_NEWPART : "Part", ID_FILE_NEWMODEL : "Model"} @@ -176,18 +176,19 @@ self.sizeChanged = False -class MainFrame(wxFrame): +class PanGalaxian(wxFrame): """ - The main PanGalaxian window + Main window frame for the PGEF desktop client. """ def __init__(self, parent, ID, title, pos, size): wxFrame.__init__(self, parent, ID, title,pos, size) - try: readState() readPrefs() state['workingdir'] = workingdir state['loggedin'] = '' + writeState() + # TODO: make this configurable self.secure = 1 self.WorkInProgress = False self.SearchFrame = None @@ -201,10 +202,8 @@ self.GodMenu = None self.GodMode = None self.SpecialPos = 5 - if not os.path.exists('tmp'): os.makedirs('tmp') - self.CreateMenu() self.sb = CustomStatusBar(self) self.SetStatusBar(self.sb) @@ -215,9 +214,7 @@ self.HelpTitle = "About " + self.AppTitle self.HelpText = "This is the Pan Galactic Engineering Framework.\n\n" + \ "Help TBD RSN" - EVT_SIZE(self, self.OnSize) - EVT_MENU(self, ID_FILE_COMMIT, self.Commit) EVT_MENU(self, ID_FILE_EXIT, self.OnClose) EVT_MENU(self, ID_FILE_CLOSETOOL, self.CloseTools) @@ -258,7 +255,6 @@ showloginconfirm = prefs.get('ShowLoginConfirmed', True) self.menuBar.Check(ID_PREF_SHOWLOGINCONFIRMED, int(showloginconfirm)) - if not prefs.get('userid', None): dlg = wxDialog(self, -1, "Required information missing", size=wxSize(350, 200), style=wxCAPTION) @@ -291,28 +287,30 @@ if dlg.ShowModal() == wxID_OK: prefs['userid'] = username.GetValue() prefs['email'] = email.GetValue() + writePrefs() dlg.Destroy() useroid = prefs.get('email', None) or prefs.get('userid', 'newbie') - print 'pangalaxian: useroid =', useroid + print 'PanGalaxian: useroid =', useroid self.user = Person(pgef_oid=useroid, id=prefs.get('userid', useroid), email=prefs.get('email', 'local')) - print 'pangalaxian: user =', self.user.id + print 'PanGalaxian: userid =', self.user.id + state['currentuser'] = self.user.id oid.setOidBase(useroid) state['currentprojectname'] = state.get('lastproject', None) or prefs.get( 'defaultproject', - 'NOPROJECT') - print 'pangalaxian: current project =', state['currentprojectname'] + 'NoProject') + writeState() + print 'PanGalaxian: current project =', state['currentprojectname'] self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, projectid=state['currentprojectname']) - state['loggedin'] = '1' self.ActivateTool() - self.OnServerCombo() + self.OnModeChange() show_tooltips = prefs.get("ShowToolTips", False) if show_tooltips: wxToolTip_Enable(True) @@ -421,19 +419,29 @@ self.menuBar.Append(menu, "&Cache") submenu = wxMenu() - submenu.Append(ID_PREF_TOOLTIPS, 'Show &Tooltips', 'Turn on/off flyover help', True) - submenu.Append(ID_PREF_SHOWLOGINCONFIRMED, 'Show Login &Confirmed', 'Show/hide login confirmation', True) - submenu.Append(ID_PREF_OUTPUTDIR, 'Set &Output Directory...', 'Where do my reports go?') - submenu.Append(ID_PREF_PROXY, 'Pro&xy...', 'Set your proxy (if any)') - submenu.Append(ID_PREF_SERVER2, '&Repository...', 'What repository do I use?') - submenu.Append(ID_PREF_USERID, '&Userid...', 'Set the locally stored userid') - submenu.Append(ID_PREF_PASSWD, 'Change &Password...', 'Change your password') + submenu.Append(ID_PREF_TOOLTIPS, 'Show &Tooltips', + 'Turn on/off flyover help', True) + submenu.Append(ID_PREF_SHOWLOGINCONFIRMED, + 'Show Login &Confirmed', + 'Show/hide login confirmation', True) + submenu.Append(ID_PREF_OUTPUTDIR, + 'Set &Output Directory...', + 'Where do my reports go?') + submenu.Append(ID_PREF_PROXY, + 'Pro&xy...', 'Set your proxy (if any)') + submenu.Append(ID_PREF_SERVER2, + '&Repository...', 'What repository do I use?') + submenu.Append(ID_PREF_USERID, + '&Userid...', 'Set the locally stored userid') + submenu.Append(ID_PREF_PASSWD, + 'Change &Password...', 'Change your password') submenu.Enable(ID_PREF_PASSWD, False) self.menuBar.Append(submenu, "&Options") menu = wxMenu() menu.Append(ID_HELP_ABOUT, "&About", "Build Date and Version") - menu.Append(ID_HELP_CONTENTS, "&Contents", "General information about this program") + menu.Append(ID_HELP_CONTENTS, + "&Contents", "General information about this program") self.menuBar.Append(menu, "&Help") self.SetMenuBar(self.menuBar) @@ -445,33 +453,71 @@ def CheckAndLoadTool(self): self.InitializeTool() + def OnExportProperties(self, event): - self.psmtool.ExportProperties() + self.psmtool.exportProperties() - def OnServerCombo(self, event=None): - print "pangalaxian.OnServerCombo, state =", state - print " - prefs =", prefs - print " - state =", state - if not state['loggedin']: - print "in local mode" + + def OnModeChange(self, event=None): + print "PanGalaxian.OnModeChange" + print " - prefs:" + for p in prefs: + print " * %s : %s" % (p, prefs[p]) + print " - state:" + for s in state: + print " * %s : %s" % (s, state[s]) + self.psmtool.onModeChange() + if state['loggedin']: + print "\n *** logged in (non-local mode) ***\n" + # GUI state changes + self.removeSpecialMenus(self.dm.user) + self.menuBar.Enable(ID_PREF_PROXY, 0) + self.menuBar.Enable(ID_PREF_SERVER1, 0) + self.menuBar.Enable(ID_PREF_SERVER2, 0) + self.menuBar.Enable(ID_PREF_USERID, 0) + self.menuBar.Enable(ID_FILE_LOGIN, 0) + self.menuBar.Enable(ID_FILE_LOGOUT, 1) + self.menuBar.Enable(ID_FILE_COMMIT, 1) + self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 1) + self.menuBar.Enable(ID_TOOL_SEARCH, 1) + self.menuBar.Enable(ID_PREF_PASSWD, 1) + self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) + self.sb.SetServer(''.join(['Repository: ', + self.dm.serverHost, + ':', + self.dm.serverPort])) + self.sb.ShowImage(True) + else: + print "\n *** not logged in (local mode) ***\n" + # GUI state changes + self.addSpecialMenus(self.dm.user) + self.menuBar.Enable(ID_FILE_LOGIN, 1) + self.menuBar.Enable(ID_PREF_PROXY, 1) + self.menuBar.Enable(ID_PREF_SERVER1, 1) + self.menuBar.Enable(ID_PREF_SERVER2, 1) + self.menuBar.Enable(ID_PREF_USERID, 1) + self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) + self.menuBar.Enable(ID_FILE_LOGOUT, 0) + self.menuBar.Enable(ID_FILE_COMMIT, 0) + self.menuBar.Enable(ID_PREF_PASSWD, 0) + self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 0) + self.menuBar.Enable(ID_TOOL_SEARCH, 0) self.menuBar.Enable(ID_FILE_LOGIN, True) - self.psmtool.SetupForLocalMode() + self.sb.SetServer('Local') self.sb.ShowImage(False) - else: - print "in non-local mode" - self.psmtool.SetupForLogin() - self.sb.ShowImage(True) + def OnSearch(self, event): self.psmtool.OnSearchItems() + def OnNewPart(self, event): - # print "psmtool.onnewpart" + print "PanGalaxian.OnNewPart" metadata = ["MENU", None, "Part"] self.psmtool.OnNewPart(metadata) def OnNewModel(self, event): - # print "psmtool.onnewmodel" + print "PanGalaxian.OnNewModel" metadata = ["MENU", None, "Model"] self.psmtool.OnNewModel(metadata) @@ -483,7 +529,8 @@ def OnClearLocalDB(self, event): if self.dm.uncommittedData(): - msg = "You have uncommitted changes. Really clear the local cache?" + msg = """ + You have uncommitted changes. Really clear the local cache?""" else: msg = "Really clear the local cache?" @@ -519,7 +566,7 @@ event.Skip() def OnEnableTooltips(self, event): - print "pangalaxian.enable_tooltips" + print "PanGalaxian.OnEnableTooltips" id = event.GetId() checked = self.menuBar.FindItemById(id).IsChecked() if checked: @@ -542,9 +589,13 @@ def OnSetUserId(self, event): user = prefs.get('userid', None) if user: - dlg = wxTextEntryDialog(self, 'Set locally stored userid to?', 'Setup UserId', user) + dlg = wxTextEntryDialog(self, + 'Set locally stored userid to?', + 'Setup UserId', user) else: - dlg = wxTextEntryDialog(self, 'Set locally stored userid to?', 'Setup UserId', 'Unknown') + dlg = wxTextEntryDialog(self, + 'Set locally stored userid to?', + 'Setup UserId', 'Unknown') dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['userid'] = dlg.GetValue() @@ -560,10 +611,13 @@ def showUser(self, mode): tmpsize = wxSize(650, 500) - user_frame = toolframe.toolFrame(self, -1, "User Data", wxDefaultPosition, tmpsize) + user_frame = toolframe.toolFrame(self, -1, "User Data", + wxDefaultPosition, tmpsize) user_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, "&Close") - user_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") - user_frame.mainpanel = userinfo.UserInfo(user_frame, -1, mode = mode, datamgr = self.dm) + user_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, + "Close this window") + user_frame.mainpanel = userinfo.UserInfo(user_frame, -1, mode=mode, + datamgr=self.dm) user_frame.CentreOnParent() user_frame.Show(True) @@ -615,7 +669,7 @@ self.dm.changePassword(login_passwd, new_password, self.dm.user.id, - secure = self.secure) + secure=self.secure) else: dlg.clearFields() dlg.SetTitle("Try Again?") @@ -631,7 +685,6 @@ # print dlg.GetTitle() if dlg.ShowModal() == wxID_OK: # print "passwds", dlg.getOldPasswd(), dlg.getNewPasswd(), dlg.getConfirmPasswd() - if dlg.getNewPasswd() == dlg.getConfirmPasswd(): # print "changed" still_trying = False @@ -639,7 +692,7 @@ self.dm.changePassword(new_password, login_passwd, userid, - secure = self.secure) + secure=self.secure) else: dlg.clearFields() dlg.SetTitle("Try Again?") @@ -656,9 +709,6 @@ - - - ## def onAdminPasswd(self, event): ## print "hook up pythoncard window here. TBD RSN" ## self.onPasswd(event) @@ -725,9 +775,13 @@ def OnSetOutputDir(self, event): outdir = prefs.get('outputdir', None) if outdir: - dlg = wxTextEntryDialog(self, 'Set output directory?', 'Set OutputDir', outdir) + dlg = wxTextEntryDialog(self, + 'Set output directory?', + 'Set OutputDir', outdir) else: - dlg = wxTextEntryDialog(self, 'Set output directory?', 'Set OutputDir', '') + dlg = wxTextEntryDialog(self, + 'Set output directory?', + 'Set OutputDir', '') dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: prefs['outputdir'] = dlg.GetValue() @@ -748,7 +802,8 @@ serverhost.strip() port.strip() if serverhost == '' or port == '': - errdlg = wxMessageDialog(self, "A server and a port are required", + errdlg = wxMessageDialog(self, + "A server and a port are required", "Unable to comply", wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() @@ -771,8 +826,10 @@ serverhost.strip() port.strip() if serverhost == '' or port == '': - errdlg = wxMessageDialog(self, "A server and a port are required", "Unable to comply", - wxOK|wxCENTRE|wxICON_EXCLAMATION) + errdlg = wxMessageDialog(self, + "A server and a port are required", + "Unable to comply", + wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() else: @@ -785,7 +842,7 @@ def OnDBBrowser(self, event): - # print "pangalaxian.ondbbrowser" + print "PanGalaxian.OnDBBrowser" tmpsize = wxSize(750, 500) dbb_frame = toolframe.toolFrame(self, -1, 'Local Database Browser', wxDefaultPosition, tmpsize) @@ -800,38 +857,39 @@ dbb_frame.Show(True) - def OnGridToPdf(self, event = None): + def OnGridToPdf(self, event=None): self.psmtool.OnGridToPdf() def OnGetMyStuff(self, event=None): if state['loggedin']: if not self.SearchFrame: - self.SearchFrame = searchframe.SearchFrame(self, - -1, + self.SearchFrame = searchframe.SearchFrame(self, -1, 'Search', - datamanager = self.dm) + datamanager=self.dm) self.SearchFrame.CentreOnParent() self.SearchFrame.Show(True) EVT_CLOSE(self.SearchFrame, self.CloseSearchFrame) - EVT_BUTTON(self.SearchFrame, self.SearchFrame.getCloseWgt().GetId(), self.CloseSearchFrame) + EVT_BUTTON(self.SearchFrame, + self.SearchFrame.getCloseWgt().GetId(), + self.CloseSearchFrame) self.SearchFrame.GetMyStuff() else: self.SearchFrame.GetMyStuff() - def CloseSearchFrame (self, event = None): + def CloseSearchFrame(self, event=None): if self.SearchFrame: self.SearchFrame.Show(False) self.SearchFrame = None def Commit(self, event): - print "pangalaxian.commit" + print "PanGalaxian.Commit" objlist = self.dm.getUncommittedObjs() - self.psmtool.Commit(closing = False, objectlist = objlist, dont_ask = False) + self.psmtool.Commit(closing=False, objectlist=objlist, dont_ask=False) - def CloseActiveTool (self, event): + def CloseActiveTool(self, event): self.psmtool.CloseTool(event) self.psmtool = None self.SetTitle(PGEF_TITLE) @@ -839,43 +897,56 @@ self.psmtool.UpdateMenuBar() - def CloseTools(self, event = None): + def CloseTools(self, event=None): + print 'PanGalaxian.CloseTools' self.psmtool.CloseTool(event) self.SetTitle(PGEF_TITLE) + def onAbout(self, event): - dlg = AboutBox(self, -1, self.HelpTitle, wxDefaultPosition, wxSize(300, 200)) + dlg = AboutBox(self, -1, + self.HelpTitle, + wxDefaultPosition, + wxSize(300, 200)) dlg.GetVersion().SetLabel(self.Version) dlg.GetBuildDate().SetLabel(self.BuildDate) dlg.CentreOnParent() dlg.Show(True) + def onContents(self, event): dlg = wxMessageDialog(self, self.HelpText, self.HelpTitle, wxOK|wxCENTRE|wxICON_EXCLAMATION) dlg.ShowModal() + def addSpecialMenus(self, user_info): if self.dm.user.god: self.AddGodMenu(self.dm.user) elif self.dm.user.id == "admin": # admin_flag: self.AddAdminMenu(self.dm.user) + def removeSpecialMenus(self, user_info): - if self.AdminMenu: # userinfo.id == "admin" and self.AdminMenu: #admin_flag and self.AdminMenu: + # userinfo.id == "admin" and self.AdminMenu: + if self.AdminMenu: self.RemoveAdminMenu(user_info) elif self.GodMenu: # userinfo.god and self.GodMenu: self.RemoveGodMenu() + def RemoveAdminMenu(self, user_info): self.menuBar.Remove(self.SpecialPos) # the admin menu self.menuBar.Refresh() self.AdminMenu = None + def adminMenu(self): adminmenu = wxMenu() - adminmenu.Append(ID_ADMIN_SEARCHUSER, "&Find User...", "Search for a user") + adminmenu.Append(ID_ADMIN_SEARCHUSER, + "&Find User...", + "Search for a user") return adminmenu @@ -887,7 +958,9 @@ """ if self.AdminMenu == None: self.AdminMenu = self.adminMenu() - self.menuBar.Insert(self.SpecialPos, self.AdminMenu, "Administrator") + self.menuBar.Insert(self.SpecialPos, + self.AdminMenu, + "Administrator") self.menuBar.Refresh() def RemoveGodMenu(self, user_info): @@ -902,34 +975,24 @@ if the user logged in has God access.""" if self.GodMenu == None: self.GodMenu = wxMenu() - self.GodMenu.Append(ID_ADMIN_PASSWD, "Change &Password...", "Change Administrator Password") + self.GodMenu.Append(ID_ADMIN_PASSWD, + "Change &Password...", + "Change Administrator Password") AdminMenu = self.adminMenu() - self.GodMenu.AppendMenu(ID_SPECIAL_ADMIN, '&Administrator', AdminMenu) + self.GodMenu.AppendMenu(ID_SPECIAL_ADMIN, + '&Administrator', + AdminMenu) self.menuBar.Insert(self.SpecialPos, self.GodMenu, "God") -# self.menuBar.Check(ID_PGDEV_ITEM, 1) + # self.menuBar.Check(ID_PGDEV_ITEM, 1) self.menuBar.Refresh() def OnLogout(self, event): - self.menuBar.Enable(ID_FILE_LOGIN, 1) - self.menuBar.Enable(ID_PREF_PROXY, 1) - self.menuBar.Enable(ID_PREF_SERVER1, 1) - self.menuBar.Enable(ID_PREF_SERVER2, 1) - self.menuBar.Enable(ID_PREF_USERID, 1) - self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) - - self.menuBar.Enable(ID_FILE_LOGOUT, 0) - self.menuBar.Enable(ID_FILE_COMMIT, 0) - self.menuBar.Enable(ID_PREF_PASSWD, 0) - self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 0) - self.menuBar.Enable(ID_TOOL_SEARCH, 0) state['loggedin'] = '' - self.sb.SetServer('Local') - self.OnServerCombo() + self.OnModeChange() def OnLogin(self, event): - print "pangalaxian.OnLogin" - state['loggedin'] = '1' + print "PanGalaxian.OnLogin" loginconfirm = prefs.get('ShowLoginConfirmed', None) dialog = LoginClass(self, -1, "PGEF Login" ) if loginconfirm == None: @@ -981,45 +1044,15 @@ wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) - - self.dm.getProjects() - self.removeSpecialMenus(self.dm.user) - - self.menuBar.Enable(ID_PREF_PROXY, 0) - self.menuBar.Enable(ID_PREF_SERVER1, 0) - self.menuBar.Enable(ID_PREF_SERVER2, 0) - self.menuBar.Enable(ID_PREF_USERID, 0) - self.menuBar.Enable(ID_FILE_LOGIN, 0) - - self.menuBar.Enable(ID_FILE_LOGOUT, 1) - self.menuBar.Enable(ID_FILE_COMMIT, 1) - self.menuBar.Enable(ID_TOOL_GETMYSTUFF, 1) - self.menuBar.Enable(ID_TOOL_SEARCH, 1) - self.menuBar.Enable(ID_PREF_PASSWD, 1) - self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) - - self.sb.SetServer(''.join(['Repository: ', - self.dm.serverHost, - ':', - self.dm.serverPort])) - self.sb.ShowImage(True) - self.psmtool.UpdateForLogin() - self.addSpecialMenus(self.dm.user) - self.OnServerCombo() - dlg.Destroy() - dialog.Destroy() still_trying = False + state['loggedin'] = '1' + self.OnModeChange() if prefs.get('ShowLoginConfirmed', None): sdlg = wxMessageDialog(self, "Login successful.", "Yay!", wxOK) - if (not state.get('currentprojectname', None) and - prefs.get('project', None)): - state['currentprojectname'] = prefs['project'] - else: - state['currentprojectname'] = 'NoProject' sdlg.CentreOnParent() sdlg.ShowModal() sdlg.Destroy() @@ -1034,6 +1067,7 @@ """ # Since close is called from inside this method, the guard variable # self.Closing skips the event if shut down is already in progress. + print 'PanGalaxian.OnClose()' if self.Closing: event.Skip() else: @@ -1070,7 +1104,7 @@ dlg.Destroy() def ActivateTool(self): - print "pangalaxian.ActivateTool, state =", state + print "PanGalaxian.ActivateTool" if self.psmtool and self.psmtool.IsShown(): return @@ -1088,7 +1122,7 @@ def InitializeTool(self): - # print "pangalaxian.initializetool", self.State + print "PanGalaxian.InitializeTool", self.State tbh = self.GetToolBar().GetSizeTuple()[1] pos = wxPoint (0, tbh) @@ -1107,7 +1141,7 @@ class MyApp(wxApp): def OnInit(self): - self.frame = MainFrame(NULL, -1, PGEF_TITLE, wxDefaultPosition, wxSize(800, 600)) + self.frame = PanGalaxian(NULL, -1, PGEF_TITLE, wxDefaultPosition, wxSize(800, 600)) self.frame.CentreOnParent() self.frame.Show(True) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.176 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.177 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.176 Sun Aug 15 17:51:01 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Mon Aug 16 06:14:18 2004 @@ -1,16 +1,11 @@ -#!/usr/bin/env python -#---------------------------------------------------------------------------- -# $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/psmtool.py,v $ -# Author: Bryan Muir -# Created: 04/05/2001 -# Copyright: -#---------------------------------------------------------------------------- +# $Id: psmtool.py,v 1.177 2004/08/16 10:14:18 waterbug Exp $ +# Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.176 $"[11:-2] +__version__ = "$Revision: 1.177 $"[11:-2] import os @@ -63,7 +58,7 @@ from pangalactic.client.modules.psm.partslisttreeframe import PartsListTreeFrame try: - # this imports are for ExportProperties + # this imports are for exportProperties from pangalactic.client.modules.psm import partslistview from pangalactic.client.modules.plm.ms2file import Data2MS CAN_EXPORT_PROPERTIES = True @@ -247,7 +242,7 @@ self.itemgrid.setVerticalOffset(toolbarsize[1]) self.modelgrid.setVerticalOffset(toolbarsize[1]) self.itemlistcount = None - self.UpdateForLogin() + self.onModeChange() self.topWindow.toppanel.GetProjectWidget().SetSelection(0) self.topWindow.toppanel.GetItemWidget().SetSelection(0) self.DisplayWgts = [] @@ -314,7 +309,7 @@ def synchGridSelections(self, obj): - # print "psmtool.synchGridSelections" + print "PSMTool.synchGridSelections" objclass = obj.__class__.__name__ if objclass == "Part": @@ -333,7 +328,7 @@ self.itemgrid.SelectRow(row) def onGridClick(self, event): - # print "psmtool.ongridclick" + print "PSMTool.onGridClick" ndx = event.GetRow() grid = event.GetEventObject() obj = grid.getObject(ndx) @@ -342,7 +337,7 @@ def onGridClickGetVersions(self, event): - # print "psmtool.ongridclickgetversions" + print "PSMTool.onGridClickGetVersions" ndx = event.GetRow() grid = event.GetEventObject() obj = grid.getObject(ndx) @@ -352,11 +347,11 @@ def SelectView(self, event): - print "psmtool.selectview" + print "PSMTool.SelectView" def pageChanged(self, event): - # print "psmtool.pagechanged" + print "PSMTool.pageChanged" gridpage = self.grid_notebook.GetSelection() grid = self.GetCurrentGrid() @@ -371,7 +366,7 @@ def GetCurrentGrid(self, currentpage = None): - # print "psmtool.getcurrentgrid", currentpage + print "PSMTool.GetCurrentGrid", currentpage currentgrid = None if currentpage == None: currentpage = self.grid_notebook.GetSelection() @@ -385,8 +380,8 @@ return currentgrid - def ExportProperties(self): - # print "psmtool.exportproperties" + def exportProperties(self): + print "PSMTool.exportProperties" if not CAN_EXPORT_PROPERTIES: print "Export to MS Excel is not available." return @@ -518,8 +513,8 @@ pass - def RebuildMainTree(self): - # print "psmtool.rebuildmaintree" + def rebuildMainTree(self): + print "PSMTool.rebuildMainTree" projectndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() if projectndx > 0: itemndx = self.topWindow.toppanel.GetItemWidget().GetSelection() @@ -544,7 +539,7 @@ self.dm) self.projectframe.Show(True) - def CloseProjectFrame(self, event = None): + def CloseProjectFrame(self, event=None): if self.projectframe: self.projectframe.Show(False) self.projectframe = None @@ -554,7 +549,7 @@ """ Create/Show the Edit Window. """ - # print "psmtool.showeditframe", rootobj.id, mode + print "PSMTool.ShowEditFrame", rootobj.id, mode if self.itemeditform: self.itemeditform.Setup(rootobj, nodedata, self.DisplayWgts, mode) if not self.itemeditform.IsShown(): @@ -585,7 +580,7 @@ mode=itemeditframe.NEW_MODE) def OnNewModel(self, metadata): - # print "psmtool.onnewmodel" + print "PSMTool.OnNewModel" obj = self.dm.newObject(metadata[2]) self.ShowEditFrame(rootobj=obj, nodedata=metadata, @@ -593,8 +588,8 @@ def OnNewPartsList(self): - # print "psmtool.onnewparts" - # print "currentproject", state['currentprojectname'] + print "PSMTool.OnNewPartsList" + print "currentproject", state['currentprojectname'] foo = PartsListTreeFrame(self.Parent, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) @@ -603,7 +598,7 @@ def OnNewDoc(self): - # print "psmtool.onnewdoc", state['currentprojectname'] + print "PSMTool.OnNewDoc", state['currentprojectname'] foo = DocumentTreeFrame(self.Parent, self.dm) foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) @@ -651,8 +646,8 @@ device and send it to the server. """ - print "psmtool.commit", len(objectlist) - # print objectlist + print "PSMTool.Commit", len(objectlist) + print "objectlist: ", objectlist retval = [] if self.dm.uncommittedData(): if dont_ask: @@ -731,25 +726,11 @@ dlg.Destroy() else: - print "psmtool.commit: local mode; do nothing???" - - - def UpdateForLogin(self): - print "psmtool.updateforlogin" - if state['loggedin']: - self.topWindow.toppanel.FillProjectWidget(self.dm.projects, - "NoProject") - wgt = self.topWindow.toppanel.GetItemWidget() - wgt.SetSelection(0) - self.tree.DeleteAllItems() - self.itemgrid.ClearGrid() - self.modelgrid.ClearGrid() - state['currentuser'] = self.dm.user.id - self.OnSelectProject() + print "PSMTool.Commit: local mode; do nothing???" def OnItemExpanding(self, event): - # print "psmtool.onitemexpanding" + print "PSMTool.OnItemExpanding" cookie = wxNewId() node = event.GetItem() # This event can happen twice in the self.Expand call @@ -762,8 +743,8 @@ return else: - # print "looking for children" - self.dm.setCurrentProject(state['currentprojectname']) + print "looking for children" + # self.dm.setCurrentProject(state['currentprojectname']) treetuple = self.tree.GetPyData(node) obj = self.dm.getLookupObject(treetuple[1]) if not self.inLocalMode(): @@ -839,7 +820,7 @@ def OnTreeActivate(self, event): - # print "psmtool.ontreeactivate" + print "PSMTool.OnTreeActivate" treeobj = self.tree.GetPyData(event.GetItem()) nauoid = treeobj[0] itemid = treeobj[1] @@ -862,7 +843,7 @@ break def CheckForUncommittedData(self, closing = False): - # print "psmtool.CheckForUncommittedData" + print "PSMTool.CheckForUncommittedData" if self.dm.inLocalMode: print "Why check for uncommitted data in local mode???" return @@ -878,7 +859,7 @@ def showItem(self, itemobj): - # print "psmtool.showitem", itemobj.id + print "PSMTool.showItem", itemobj.id itemid = itemobj.pgef_oid self.tree.DeleteAllItems() @@ -894,7 +875,7 @@ def OnItemClick(self, event = None): - # print "psmtool.onitemclick" + print "PSMTool.OnItemClick" ndx = self.topWindow.toppanel.GetItemWidget().GetSelection() if ndx == 0: wgt = self.topWindow.toppanel.GetProjectWidget() @@ -925,28 +906,28 @@ if dlg: dlg.Destroy() wxEndBusyCursor() - # print "end onitemclick" + print "end onitemclick" def OnSelectProject(self, event = None): - # print "psmtool.onselectproject" + print "PSMTool.OnSelectProject" wgt = self.topWindow.toppanel.GetProjectWidget() selection = wgt.GetStringSelection() ndx = wgt.GetSelection() - if selection == 'Select a Project': - if state['currentprojectname']: - project = state.get('currentprojectname', 'None') - print 'currentprojectname = ', project - wgt.SetSelection(wgt.FindString(project)) - self.dm.setCurrentProject(project) - ndx = wgt.GetSelection() - if ndx > 0: - self.changeProject(ndx, selection) + # if selection == 'Select a Project': + # if state.get('currentprojectname', 'None'): + # project = state['currentprojectname'] + # print 'currentprojectname = ', project + # wgt.SetSelection(wgt.FindString(project)) + # self.dm.setCurrentProject(project) + # ndx = wgt.GetSelection() + # if ndx > 0: + self.changeProject(ndx, selection) def changeProject(self, ndx, projectname): - # print "psmtool.changeProject" - # print "project ndx", projectname, ndx + print "PSMTool.changeProject" + print "project ndx", projectname, ndx if self.itemeditform: self.itemeditform.SecureMode() state['lastproject'] = projectname @@ -1005,7 +986,7 @@ wxEndBusyCursor() if ndx > 0: self.dm.setCurrentProject(projectname) - # print "end psmtool.changeProject" + print "end PSMTool.changeProject" def UpdateWindows(self): if self.projectframe: @@ -1018,8 +999,8 @@ def UpdateWgts(self, newitem): - # print "psmtool.updatewgts" - # print 'DisplayWgts are: ', self.DisplayWgts + print "PSMTool.UpdateWgts" + print 'DisplayWgts are: ', self.DisplayWgts for ndx in range(len(self.DisplayWgts)): wgt = self.DisplayWgts[ndx][0] wgttype = self.DisplayWgts[ndx][1] @@ -1039,7 +1020,7 @@ def FillGridFromProject(self, projectname): - # print "psmtool.fillgridfromproject", projectname + print "PSMTool.FillGridFromProject", projectname localproducts = self.dm.getLocalObjectsOfTypes(["Part", "Model"], projectname) products = localproducts.values() @@ -1061,7 +1042,7 @@ def FillItemWidgetFromProject(self, projectname): - # print "psmtool.fillitemwgt" + print "PSMTool.FillItemWidgetFromProject" localitems = self.dm.getLocalObjectsOfTypes(["Model"], projectname) localparts = localitems.values() itemlist = [] @@ -1073,14 +1054,14 @@ def FillGridWithModels(self, grid, productlist, uncommitted_oids=None): - # print "fillgridwithmodels" + print "PSMTool.FillGridWithModels" if uncommitted_oids == None: uncommitted_oids = [] grid.BeginBatch() grid.ClearGrid() for pname, product in productlist: if product.pgef_oid in uncommitted_oids: - # print pname, "is grey" + print pname, "is grey" grid.AddData(product, colour = wxLIGHT_GREY) else: grid.AddData(product) @@ -1090,15 +1071,15 @@ grid.EndBatch() def FillGridWithParts(self, grid, productlist, uncommitted_oids=None): - # print "fillgridwithparts" + print "PSMTool.FillGridWithParts" if uncommitted_oids == None: uncommitted_oids = [] grid.BeginBatch() grid.ClearGrid() for pname, product in productlist: - # print pname, product.id, product.pgef_oid + print pname, product.id, product.pgef_oid if product.pgef_oid in uncommitted_oids: - # print pname, "is grey" + print pname, "is grey" grid.AddData(product, colour = wxLIGHT_GREY) else: grid.AddData(product) @@ -1108,17 +1089,23 @@ grid.EndBatch() - def FillLocalModeProjectWidget(self): - # print "psmtool.filllocalmodeprojectwidget" + def FillProjectWidget(self): + print "PSMTool.ProjectWidget" wgt = self.topWindow.toppanel.GetProjectWidget() wgt.Clear() - wgt.Append('Select a project') + # wgt.Append('Select a project') projects = self.dm.getProjects() if projects: for pkey, proj in projects.items(): wgt.Append(proj.id) wgt.Enable(True) - wgt.SetSelection(0) + if state['currentprojectname']: + ndx = wgt.FindString(state['currentprojectname']) + if ndx <> wxNOT_FOUND: + wgt.SetSelection(wgt.FindString(state['currentprojectname'])) + wgt.SetStringSelection(state['currentprojectname']) + else: + wgt.SetSelection(0) def inLocalMode(self): @@ -1128,36 +1115,35 @@ self.tree.DeleteAllItems() - def SetupForLocalMode(self, event = None): - # print "setupforlocalmode" - self.FillLocalModeProjectWidget() - self.Parent.sb.SetServer('Local') - self.tree.DeleteAllItems() - state['currentuser'] = self.dm.user.id - wgt = self.Parent.menuBar.FindMenuItem('Repository', - 'Get Marked Items') - self.Parent.menuBar.Enable(wgt, False) - wgt = self.topWindow.toppanel.GetProjectWidget() - if state['currentprojectname']: - ndx = wgt.FindString(state['currentprojectname']) - if ndx <> wxNOT_FOUND: - wgt.SetSelection(wgt.FindString(state['currentprojectname'])) - wgt.SetStringSelection(state['currentprojectname']) - ndx = wgt.GetSelection() - projectname = wgt.GetStringSelection() - if ndx > 0: + def onModeChange(self, event=None): + """ + Trigger PSMTool local/remote-dependent interface adjustments. + """ + if state['loggedin']: + print "PSMTool.onModeChange (loggedin)" + self.FillProjectWidget() + wgt = self.topWindow.toppanel.GetItemWidget() + wgt.SetSelection(0) + self.tree.DeleteAllItems() + self.itemgrid.ClearGrid() + self.modelgrid.ClearGrid() + state['currentuser'] = self.dm.user.id + self.OnSelectProject() + else: + print "PSMTool.onModeChange (local)" + self.FillProjectWidget() + self.Parent.sb.SetServer('Local') + wgt = self.Parent.menuBar.FindMenuItem('Repository', + 'Get Marked Items') + self.Parent.menuBar.Enable(wgt, False) + wgt = self.topWindow.toppanel.GetProjectWidget() + ndx = wgt.GetSelection() + projectname = wgt.GetStringSelection() self.changeProject(ndx, projectname) - def SetupForLogin(self): - # print "setupforlogin" - wgt = self.Parent.menuBar.FindMenuItem('Repository', - 'Get Marked Items') - self.Parent.menuBar.Enable(wgt, True) - - def BuildTree(self, itemid): - # print "psmtool.buildtree" + print "PSMTool.BuildTree" try: self.tree.DeleteAllItems() self.dm.clearNauoIDs() @@ -1165,17 +1151,17 @@ obj = self.dm.getLookupObject(itemid) self.tree.LoadTreefromObjects(self.dm, obj) except: - print "psmtool.buildtree.error" + print "PSMTool.BuildTree.error" def OnEditComponent(self, event): - # print "psmtool.oneditcomponent" + print "PSMTool.OnEditComponent" evtobj = event.GetEventObject() if isinstance(evtobj, wxMenu): node = self.tree.GetSelection() elif isinstance(evtobj, wxTreeCtrl): node = event.GetEventObject().GetSelection() else: - print "psmtool.oneditcomponent::Unable to edit" + print "PSMTool.OnEditComponent: Unable to edit!" return if node.IsOk(): @@ -1188,7 +1174,7 @@ pane = 0 elif classname == "Model": pane = 1 - # print 'product class is:', classname + print 'item class is:', classname metadata = ["TREE", product_id, classname] self.ShowEditFrame(rootobj=temp_obj, nodedata=metadata, @@ -1197,7 +1183,7 @@ wxSafeYield() def onGridPopupEdit(self, event): - print "psmtool.ongridpopupedit" + print "PSMTool.onGridPopupEdit" currentgrid = self.GetCurrentGrid() selectedrow = currentgrid.GetSelectedRows() print "selectedrow", selectedrow @@ -1208,7 +1194,7 @@ def onGridDClick (self, event): - # print "ongriddclick" + print "PSMTool.onGridDClick" row = event.GetRow() grid = event.GetEventObject() grid.SelectRow(row) @@ -1217,7 +1203,7 @@ def editGridObject(self, obj): - print "psmtool.editgridobject", obj.id, obj.__class__.__name__ + print "PSMTool.editGridObject", obj.id, obj.__class__.__name__ classname = obj.__class__.__name__ dlg = None if state['loggedin']: Index: PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py diff -u PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.13 PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.14 --- PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py:1.13 Sun Aug 15 15:58:38 2004 +++ PanGalactic/pangalactic/client/modules/psm/toolbarpanel.py Mon Aug 16 06:14:18 2004 @@ -20,7 +20,6 @@ self.SetSizer(sizer) self.projectlist = [] - self.projectlabel = "Select a Project" self.itemlist = [] self.itemlabel = "Select a Product Model" # WDR: handler declarations for ItemSearchForm @@ -37,29 +36,6 @@ # def GetButtonTopLevel(self): # return wxPyTypeCast(self.FindWindowById(TOPLEVELITEMS_BUTTON), "wxButton") - - # refactor this? - def FillProjectWidget(self, ProjectList, projectlabel=None): - """Fills the Project combo box, assumes that the project list is passed in""" - #print "toolbarpanel.fillprojectwgt" - widget = self.GetProjectWidget() - widget.Clear() - projectlist = ProjectList.keys() - - if len(projectlist) == 0: - widget.Enable(False) - return - - projectlist.sort() - if projectlabel: - widget.Append(projectlabel) - self.projectlabel = projectlabel - for item in projectlist: - widget.Append(ProjectList[item].id) - - widget.Enable(True) - widget.SetSelection(0) - self.projectlist = ProjectList def FillItemWidget(self, itemlist, itemlabel = None): Index: PanGalactic/pangalactic/enterprise/project.py diff -u PanGalactic/pangalactic/enterprise/project.py:1.25 PanGalactic/pangalactic/enterprise/project.py:1.26 --- PanGalactic/pangalactic/enterprise/project.py:1.25 Wed Aug 11 02:21:09 2004 +++ PanGalactic/pangalactic/enterprise/project.py Mon Aug 16 06:14:18 2004 @@ -1,12 +1,12 @@ -# $Id: project.py,v 1.25 2004/08/11 06:21:09 waterbug Exp $ +# $Id: project.py,v 1.26 2004/08/16 10:14:18 waterbug Exp $ """ A specific, identifiable activity of Organizations and Persons. -@version: $Revision: 1.25 $ +@version: $Revision: 1.26 $ """ -__version__ = "$Revision: 1.25 $"[11:-2] +__version__ = "$Revision: 1.26 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -60,7 +60,7 @@ PgefObject.__init__(self, **kw) # if id/id_context kw args are passed in, use # them; otherwise, use defaults ... - self.id = kw.get('id', 'NOPROJECT') + self.id = kw.get('id', 'NoProject') self.id_context = kw.get('id_context', 'NOCONTEXT') self.name = kw.get('name', 'NONAME') Index: PanGalactic/pangalactic/enterprise/versionedobject.py diff -u PanGalactic/pangalactic/enterprise/versionedobject.py:1.15 PanGalactic/pangalactic/enterprise/versionedobject.py:1.16 --- PanGalactic/pangalactic/enterprise/versionedobject.py:1.15 Wed Aug 11 02:21:09 2004 +++ PanGalactic/pangalactic/enterprise/versionedobject.py Mon Aug 16 06:14:18 2004 @@ -1,11 +1,11 @@ -# $Id: versionedobject.py,v 1.15 2004/08/11 06:21:09 waterbug Exp $ +# $Id: versionedobject.py,v 1.16 2004/08/16 10:14:18 waterbug Exp $ """ A thing which evolves in a set of discrete, identified incarnations. """ -__version__ = "$Revision: 1.15 $"[11:-2] +__version__ = "$Revision: 1.16 $"[11:-2] from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.meta.ontoclass import OntoClass @@ -68,7 +68,6 @@ name='HEAD', pgef_datatype='bool', default='True', - default_display='True', description=""" This flag is set to True for a VersionedObject committed as a new version (and unset on the previous head VersionedObject Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.144 PanGalactic/pangalactic/utils/datamanager.py:1.145 --- PanGalactic/pangalactic/utils/datamanager.py:1.144 Sun Aug 15 17:51:01 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 16 06:14:19 2004 @@ -3,10 +3,10 @@ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.144 $ +@version: $Revision: 1.145 $ """ -__version__ = "$Revision: 1.144 $"[11:-2] +__version__ = "$Revision: 1.145 $"[11:-2] import time import mx.DateTime @@ -77,7 +77,7 @@ self.serverPort = prefs.get('serverport', '8080') self.server = None self.refresh = False - self.CurrentProject = None + print """Calling DataManager.setCurrentProject('%s')""" % projectid self.setCurrentProject(projectid) self.projects = {} self.nauoIDs = {} @@ -377,28 +377,50 @@ self.localDB.Pack() - def getProjects(self, id_context='TEST'): - """ - Get a list of projects from the repository; save them locally, and - return them as a list. + def getProjects(self, context='TEST'): """ + Get a list of projects. If logged in, get them from the + repository, save them locally, and return them as a list. + If local, check whether there are any in localdb; if not, add the + NoProject project. + """ + if context == 'TEST' and prefs.get('context', None): + context = prefs['context'] + print 'DM.getProjects' if state['loggedin'] and self.server: - print "NOTE: default project.id_context is TEST (for now)" - fielddict = {"id_context" : id_context} + print " logged in -- going to the server ..." + print " (NOTE: default context is TEST, for now)" + fielddict = {"id_context" : context} projs = self.server.getObjects("Project", fields=fielddict, refs=1, subtypes=0, objs=None) - print 'found %s projects in context "%s"' % ( - len(projs), id_context) + print ' found %s projects in context "%s"' % ( + len(projs), context) if len(projs): - print 'they are:' + print ' they are:' for p in projs: - print p.id + print ' - %s' % p.id else: - print 'no projects found in context "%s"' % (id_context) + print ' no projects found in that context ...' + print ' setting up the NoProject project.' + projs = [Project(pgef_oid='NoProject', + id='NoProject', + name='Ni', + description='No project specified')] self.localDB.save(projs) + else: + print " in local mode -- checking localdb for projects ..." + self.projects = self.localDB.getDict(self.localDB.PROJECT) + if not self.projects: + print ' no local projects ... using NoProject.' + self.localDB.save([ + Project(pgef_oid='NoProject', + id='NoProject', + name='Ni', + description='No project specified')]) self.projects = self.localDB.getDict(self.localDB.PROJECT) + print ' ... returning projects:', self.projects.keys() return self.projects @@ -407,27 +429,19 @@ Set the current project, which will be used for all new objects that have a 'project' attribute. """ - # print "datamanager.setcurrentproject", projectname + print "DM.setCurrentProject", projectname self.CurrentProject = None allprojects = self.localDB.getDict(self.localDB.PROJECT) for k, p in allprojects.items(): if p.id == projectname: self.CurrentProject = p - if not self.CurrentProject and state['loggedin']: - fielddict = {"pgef_oid":projectname} - p = self.server.getObjects('Project', - fields=fielddict, - refs=1, - subtypes=0, - objs=None) - self.CurrentProject = p if self.CurrentProject: - print "Aha. Project", self.CurrentProject.id + print "Aha. Project '%s'" % self.CurrentProject.id else: - print "Rats! No Project. Faking it." + print "Rats! Blank Project. Faking it." # might as well make it the official "null" project ... - self.CurrentProject = Project(pgef_oid='NOPROJECT', - id='NOPROJECT', + self.CurrentProject = Project(pgef_oid='NoProject', + id='NoProject', name='Ni', description='No project specified') From waterbug at ned.gsfc.nasa.gov Mon Aug 16 06:17:25 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 16 06:17:26 2004 Subject: [Pangalactic-commits] Source -> Id. Message-ID: <200408161017.i7GAHPZX012470@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/datamanager.py 1.145 1.146 Log message: Source -> Id. Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.145 PanGalactic/pangalactic/utils/datamanager.py:1.146 --- PanGalactic/pangalactic/utils/datamanager.py:1.145 Mon Aug 16 06:14:19 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 16 06:17:23 2004 @@ -1,12 +1,12 @@ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/utils/datamanager.py,v $ +# $Id: datamanager.py,v 1.146 2004/08/16 10:17:23 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.145 $ +@version: $Revision: 1.146 $ """ -__version__ = "$Revision: 1.145 $"[11:-2] +__version__ = "$Revision: 1.146 $"[11:-2] import time import mx.DateTime From pbear at ned.gsfc.nasa.gov Mon Aug 16 14:03:01 2004 From: pbear at ned.gsfc.nasa.gov (pbear CVS) Date: Mon Aug 16 14:03:03 2004 Subject: [Pangalactic-commits] fixed NA in dbbrowser Message-ID: <200408161803.i7GI31Bo019593@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/dbbrowser.py 1.26 1.27 Log message: fixed NA in dbbrowser Index: PanGalactic/pangalactic/utils/dbbrowser.py diff -u PanGalactic/pangalactic/utils/dbbrowser.py:1.26 PanGalactic/pangalactic/utils/dbbrowser.py:1.27 --- PanGalactic/pangalactic/utils/dbbrowser.py:1.26 Sun Aug 8 21:41:24 2004 +++ PanGalactic/pangalactic/utils/dbbrowser.py Mon Aug 16 14:03:00 2004 @@ -323,12 +323,12 @@ attr = mapping[col][0] attrvalue = getattr(obj, attr) # print "attr", attr, attrvalue - try: + if 1: #try: val = str(attrvalue) classname = attrvalue.__class__.__name__ - if classname in localdb.NARS_CLASSES: - val = attrvalue.id + "(" + attrvalue.getPrettyDocType() + ")" - elif classname in localdb.PGEF_CLASSES: + #if classname in localdb.NARS_CLASSES: + # val = attrvalue.id + "(" + attrvalue.getPrettyDocType() + ")" + if classname in self.localDB._registry.pgef_classes: val = attrvalue.id + " (" + classname + ")" elif (isinstance(attrvalue, types.DictType) or @@ -338,11 +338,11 @@ attrclass = attrvalue[0].__class__.__name__ else: attrclass = attrvalue[attrvalue.keys()[0]].__class__.__name__ - if (attrclass in localdb.NARS_CLASSES or - attrclass in localdb.PGEF_CLASSES): + #if (attrclass in localdb.NARS_CLASSES or + if attrclass in self.localDB._registry.pgef_classes: val = str(len(attrvalue)) + " elements" - except: - val = "N/A" + #except: + # val = "N/A" # print "curr_row, col, val", curr_row, col, val self.grid.SetCellValue(curr_row, col, val) From pbear at ned.gsfc.nasa.gov Mon Aug 16 15:32:35 2004 From: pbear at ned.gsfc.nasa.gov (pbear CVS) Date: Mon Aug 16 15:32:37 2004 Subject: [Pangalactic-commits] fixed right_click_menu edit Message-ID: <200408161932.i7GJWZAB021454@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.177 1.178 Log message: fixed right_click_menu edit Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.177 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.178 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.177 Mon Aug 16 06:14:18 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Mon Aug 16 15:32:34 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.177 2004/08/16 10:14:18 waterbug Exp $ +# $Id: psmtool.py,v 1.178 2004/08/16 19:32:34 pbear Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.177 $"[11:-2] +__version__ = "$Revision: 1.178 $"[11:-2] import os @@ -85,7 +85,7 @@ ID_CHOICE_VIEW = wxNewId() # this is the order of the notebook pages (grids) -GRIDLIST = ["Part", "Model"] +GRIDLIST = ["Model", "Part"] def CreateTool(parent, datamgr, ID, pos): @@ -1185,10 +1185,15 @@ def onGridPopupEdit(self, event): print "PSMTool.onGridPopupEdit" currentgrid = self.GetCurrentGrid() - selectedrow = currentgrid.GetSelectedRows() - print "selectedrow", selectedrow - print "SelectedRow", currentgrid.SelectedRow - if currentgrid.SelectedRow: +# if currentgrid == self.itemgrid: +# print "itemgrid" +# print "SelectedRow", currentgrid.SelectedRow +# elif currentgrid == self.modelgrid: +# print "modelgrid" +# print "SelectedRow", currentgrid.SelectedRow +# else: +# print "foo" + if currentgrid.SelectedRow >= 0: obj = currentgrid.getObject(currentgrid.SelectedRow) self.editGridObject(obj) From waterbug at ned.gsfc.nasa.gov Mon Aug 16 16:18:47 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 16 16:18:49 2004 Subject: [Pangalactic-commits] Begin mods to Special Menus. Message-ID: <200408162018.i7GKIlbc021986@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.3 1.4 PanGalactic/pangalactic/utils/datamanager.py 1.146 1.147 Log message: Begin mods to Special Menus. Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.3 PanGalactic/pangalactic/client/pangalaxian.py:1.4 --- PanGalactic/pangalactic/client/pangalaxian.py:1.3 Mon Aug 16 06:14:17 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Mon Aug 16 16:18:45 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.3 2004/08/16 10:14:17 waterbug Exp $ +# $Id: pangalaxian.py,v 1.4 2004/08/16 20:18:45 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.3 $ +@version: $Revision: 1.4 $ """ -__version__ = "$Revision: 1.3 $"[11:-2] +__version__ = "$Revision: 1.4 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -15,6 +15,8 @@ import sys, os, time +from pangalactic.client.modules.psm import searchframe +from pangalactic.client.modules.psm import psmtool from pangalactic.enterprise.person import Person from pangalactic.utils import oid from pangalactic.utils import dbbrowser @@ -32,14 +34,9 @@ from pangalactic.utils.securitymanager import SecurityManager from pangalactic.utils.serverclass import ServerDialog from pangalactic.utils.usersearchframe import UserSearchFrame - -from pangalactic.utils.datamanager import DataManager +from pangalactic.utils.datamanager import DataManager # this is bogus -- should be hidden inside DM ... -from pangalactic.utils.datamanager import LocalStorageError - -from pangalactic.client.modules.psm import searchframe -from pangalactic.client.modules.psm import psmtool - +from pangalactic.utils.datamanager import LocalStorageError workingdir = os.getcwd() @@ -470,7 +467,8 @@ if state['loggedin']: print "\n *** logged in (non-local mode) ***\n" # GUI state changes - self.removeSpecialMenus(self.dm.user) + if self.dm.user.id != 'admin': + self.removeSpecialMenus(self.dm.user) self.menuBar.Enable(ID_PREF_PROXY, 0) self.menuBar.Enable(ID_PREF_SERVER1, 0) self.menuBar.Enable(ID_PREF_SERVER2, 0) @@ -929,10 +927,9 @@ def removeSpecialMenus(self, user_info): - # userinfo.id == "admin" and self.AdminMenu: - if self.AdminMenu: + if not userinfo.id == "admin" and self.AdminMenu: self.RemoveAdminMenu(user_info) - elif self.GodMenu: # userinfo.god and self.GodMenu: + if userinfo.god and self.GodMenu: self.RemoveGodMenu() @@ -947,6 +944,9 @@ adminmenu.Append(ID_ADMIN_SEARCHUSER, "&Find User...", "Search for a user") + adminmenu.Append(ID_ADMIN_PASSWD, + "Change &Admin Password...", + "Change admin password") return adminmenu @@ -970,9 +970,11 @@ def AddGodMenu(self, user_info): - """This method inserts the God menu on the main menubar, + """ + This method inserts the God menu on the main menubar, just to the right of the Options Menu. This only should happen - if the user logged in has God access.""" + if the user logged in has God access. + """ if self.GodMenu == None: self.GodMenu = wxMenu() self.GodMenu.Append(ID_ADMIN_PASSWD, Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.146 PanGalactic/pangalactic/utils/datamanager.py:1.147 --- PanGalactic/pangalactic/utils/datamanager.py:1.146 Mon Aug 16 06:17:23 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Mon Aug 16 16:18:46 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.146 2004/08/16 10:17:23 waterbug Exp $ +# $Id: datamanager.py,v 1.147 2004/08/16 20:18:46 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.146 $ +@version: $Revision: 1.147 $ """ -__version__ = "$Revision: 1.146 $"[11:-2] +__version__ = "$Revision: 1.147 $"[11:-2] import time import mx.DateTime @@ -115,9 +115,10 @@ def changePassword(self, login_pwd, new_pwd, userid="", secure=1): # print "update local passwds" - self.server.changePassword(new_pwd, userid) - if userid == self.user.id: - self.login(self.user.id, new_pwd, secure = secure) + if state['loggedin']: + self.server.changePassword(new_pwd, userid) + if userid == self.user.id: + self.login(self.user.id, new_pwd, secure = secure) def getConfigAccess(self): From waterbug at ned.gsfc.nasa.gov Mon Aug 16 21:36:40 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 16 21:36:41 2004 Subject: [Pangalactic-commits] These don't get called anywhere. Message-ID: <200408170136.i7H1aeCH025672@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/serverform_wdr.py 1.5 None PanGalactic/pangalactic/client/modules/psm/serverform.wdr 1.3 None Log message: These don't get called anywhere. From waterbug at ned.gsfc.nasa.gov Mon Aug 16 22:05:56 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 16 22:05:58 2004 Subject: [Pangalactic-commits] More cruft removal. Message-ID: <200408170205.i7H25uph025963@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/checkedoutgrid.py 1.18 None PanGalactic/pangalactic/client/modules/psm/configgrid.wdr 1.3 None PanGalactic/pangalactic/client/modules/psm/quickcreate.py 1.8 None PanGalactic/pangalactic/client/modules/psm/quickcreate.wdr 1.5 None PanGalactic/pangalactic/client/modules/psm/quickcreate_wdr.py 1.7 None Log message: More cruft removal. From waterbug at ned.gsfc.nasa.gov Tue Aug 17 11:47:59 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 17 11:48:02 2004 Subject: [Pangalactic-commits] Fixed selection of server for login! (+ other stuff ... ; ) Message-ID: <200408171547.i7HFlxOf032414@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.4 1.5 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py 1.13 1.14 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.24 1.25 PanGalactic/pangalactic/client/modules/psm/docform.py 1.7 1.8 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.151 1.152 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.12 1.13 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.26 1.27 PanGalactic/pangalactic/client/modules/psm/partform.py 1.12 1.13 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.37 1.38 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.38 1.39 PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py 1.29 1.30 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py 1.45 1.46 PanGalactic/pangalactic/client/modules/psm/pgeftree.py 1.39 1.40 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py 1.21 1.22 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.178 1.179 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py 1.38 1.39 PanGalactic/pangalactic/utils/datamanager.py 1.147 1.148 PanGalactic/pangalactic/utils/pgefstate.py 1.4 1.5 PanGalactic/pangalactic/utils/securitymanager.py 1.11 1.12 PanGalactic/pangalactic/utils/usersearchframe.py 1.6 1.7 Log message: Fixed selection of server for login! (+ other stuff ... ;) Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.7 PanGalactic/pangalactic/client/modules/psm/docform.py:1.8 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.7 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Tue Aug 17 11:47:56 2004 @@ -210,7 +210,7 @@ self.ClearForm() self.Enable(True) ctrl = self.GetAuthorWgt() - ctrl.SetValue(state['currentuser']) + ctrl.SetValue(state['currentuserid']) ctrl = self.GetVersionWgt() ctrl.SetValue("1") Index: PanGalactic/pangalactic/utils/usersearchframe.py diff -u PanGalactic/pangalactic/utils/usersearchframe.py:1.6 PanGalactic/pangalactic/utils/usersearchframe.py:1.7 --- PanGalactic/pangalactic/utils/usersearchframe.py:1.6 Sat Aug 14 19:54:45 2004 +++ PanGalactic/pangalactic/utils/usersearchframe.py Tue Aug 17 11:47:57 2004 @@ -1,10 +1,10 @@ -# $Id: usersearchframe.py,v 1.6 2004/08/14 23:54:45 waterbug Exp $ +# $Id: usersearchframe.py,v 1.7 2004/08/17 15:47:57 waterbug Exp $ """ wx frame for doing searches for users. -@version: $Revision: 1.6 $ +@version: $Revision: 1.7 $ """ -__version__ = "$Revision: 1.6 $"[11:-2] +__version__ = "$Revision: 1.7 $"[11:-2] from wxPython.wx import * @@ -22,7 +22,7 @@ toolframe.toolFrame.__init__(self, parent, id, title, size=size) self.Parent = parent self.SetDataManager(datamanager) - self.sb.SetUser(state['currentuser']) + self.sb.SetUser(state['currentuserid']) self.curr_user = None self.user_frame = None Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.12 PanGalactic/pangalactic/client/modules/psm/partform.py:1.13 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.12 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Tue Aug 17 11:47:56 2004 @@ -146,7 +146,7 @@ self.clearForm() self.Enable(True) self.CreatingPart = True - self.GetPoc().SetValue(state['currentuser']) + self.GetPoc().SetValue(state['currentuserid']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) Index: PanGalactic/pangalactic/client/modules/psm/pgefedittree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.45 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.46 --- PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.45 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefedittree.py Tue Aug 17 11:47:56 2004 @@ -57,7 +57,7 @@ #print "found lookupid" PdrNodes = datamanager.pdrIDs[lookupid] - elif datamanager.inLocalMode: + elif not state['loggedin']: for pdrid, pdrobj in datamanager.getDocPartLinks().items(): if pdrobj.pgef_oid == rootitemid: PdrNodes.append(pdrid) @@ -104,7 +104,7 @@ self.SetItemImage(rootnode, self.itemicon) self.SetItemImage(rootnode, self.itemicon, wxTreeItemIcon_Selected) - if not dm.inLocalMode: + if state['loggedin']: #print "getting more acus" if rootobj: dm.getNAUOByAssemblyID([rootobj.pgef_oid]) Index: PanGalactic/pangalactic/client/modules/psm/pgeftree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.39 PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.39 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgeftree.py Tue Aug 17 11:47:56 2004 @@ -11,11 +11,12 @@ from pangalactic.utils import pgefevents from pangalactic.utils import pdfoptions +from pangalactic.utils.pgefstate import state import pangalactic.client.modules.psm.itemdroptarget as itemdroptarget import pangalactic.client.io.treereport as treereport -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] class PgefTree(wxTreeCtrl): @@ -140,7 +141,7 @@ self.SetItemImage(rootnode, self.itemicon, wxTreeItemIcon_Selected) self.SetPyData(rootnode,[acu_id, rootobj.pgef_oid]) - if not dm.inLocalMode: + if state['loggedin']: #print "getting more acus" dm.getNAUOByAssemblyID([rootobj.pgef_oid]) Index: PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py diff -u PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.38 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.39 --- PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.38 Fri Aug 13 02:43:22 2004 +++ PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py Tue Aug 17 11:47:56 2004 @@ -39,8 +39,6 @@ def __init__(self): toolstate.ToolState.__init__(self) - self.workingdir = "" - self.currentuser = "" class WfProcessOverview(wxPanel): @@ -88,8 +86,6 @@ self.grid = None self.dm = datamgr self.State = WorkflowState() - self.State.workingdir = state.workingdir - self.State.currentuser = self.dm.user.id self.currentworkflow = None self.WorkflowWizardFrames = [] @@ -391,8 +387,6 @@ def UpdateForLogin(self): print "workflowoverview.updateforlogin tbd" - if state['loggedin']: - self.State.currentuser = self.dm.user.id def SetupForLogin(self): print "workflowoverview.Setupforlogin tbd" @@ -414,7 +408,7 @@ return dlg.Destroy() - if not self.dm.inLocalMode: + if state['loggedin']: savedlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(300, 75), wxTHICK_FRAME) msg = wxStaticText(savedlg, -1, "Please wait while PGEF commits the data...", wxPoint (10, 10), wxDefaultSize, wxALIGN_CENTRE) Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.4 PanGalactic/pangalactic/client/pangalaxian.py:1.5 --- PanGalactic/pangalactic/client/pangalaxian.py:1.4 Mon Aug 16 16:18:45 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Tue Aug 17 11:47:55 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.4 2004/08/16 20:18:45 waterbug Exp $ +# $Id: pangalaxian.py,v 1.5 2004/08/17 15:47:55 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.4 $ +@version: $Revision: 1.5 $ """ -__version__ = "$Revision: 1.4 $"[11:-2] +__version__ = "$Revision: 1.5 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -143,8 +143,8 @@ def ClearMsg(self): self.SetStatusText("", 1) - def SetServer(self, serverhost): - self.mytext.SetLabel(serverhost) + def SetServer(self, server): + self.mytext.SetLabel(server) def ClearServer(self): self.mytext.SetLabel(" ") @@ -182,10 +182,25 @@ try: readState() readPrefs() + # make sure some defaults are set state['workingdir'] = workingdir state['loggedin'] = '' + # set state['currentserver'] and state['serverlist'] from + # existing states and prefs, if any + currentserver = (state.get('currentserver', None) + or prefs.get('server', 'localhost:8080')) + state['currentserver'] = currentserver + serverlist = [currentserver] + if (prefs.get('server', None) + and prefs['server'] != currentserver): + serverlist.append(prefs['server']) + if state.get('serverlist', None): + for srv in state['serverlist']: + if srv not in serverlist: + serverlist.append(srv) + state['serverlist'] = serverlist writeState() - # TODO: make this configurable + # TODO: make 'secure' configurable self.secure = 1 self.WorkInProgress = False self.SearchFrame = None @@ -196,8 +211,9 @@ wxInitAllImageHandlers() self.AdminMenu = None self.AdminMode = None - self.GodMenu = None - self.GodMode = None +######### GodMenu is temporarily disabled +# self.GodMenu = None +# self.GodMode = None self.SpecialPos = 5 if not os.path.exists('tmp'): os.makedirs('tmp') @@ -209,8 +225,9 @@ self.BuildDate = BUILD_DATE self.Version = VERSION self.HelpTitle = "About " + self.AppTitle - self.HelpText = "This is the Pan Galactic Engineering Framework.\n\n" + \ - "Help TBD RSN" + self.HelpText = '\n'.join([ + "This is the Pan Galactic Engineering Framework.", + "Help TBD RSN"]) EVT_SIZE(self, self.OnSize) EVT_MENU(self, ID_FILE_COMMIT, self.Commit) EVT_MENU(self, ID_FILE_EXIT, self.OnClose) @@ -295,7 +312,7 @@ id=prefs.get('userid', useroid), email=prefs.get('email', 'local')) print 'PanGalaxian: userid =', self.user.id - state['currentuser'] = self.user.id + state['currentuserid'] = self.user.id oid.setOidBase(useroid) state['currentprojectname'] = state.get('lastproject', None) or prefs.get( @@ -307,7 +324,7 @@ self.dm = DataManager(self.WatchDog, projectid=state['currentprojectname']) self.ActivateTool() - self.OnModeChange() + self.onModeChange() show_tooltips = prefs.get("ShowToolTips", False) if show_tooltips: wxToolTip_Enable(True) @@ -347,10 +364,7 @@ tb.AddControl(wxComboBox(tb, self.ToolbarServerID, "", - choices=[''.join([self.dm.serverHost, - ':', - self.dm.serverPort]), - "Local"], + choices=state['serverlist'], size=(150,-1), style=wxCB_DROPDOWN|wxCB_READONLY)) tb.Realize() @@ -455,20 +469,29 @@ self.psmtool.exportProperties() - def OnModeChange(self, event=None): - print "PanGalaxian.OnModeChange" + def onModeChange(self, event=None): + """ + Trigger local/remote-mode state changes for PanGalaxian + (propagating the call to the onModeChange() methods for + DataManager, and PSMTool). + """ + # blab about my state + print "PanGalaxian.onModeChange" print " - prefs:" for p in prefs: print " * %s : %s" % (p, prefs[p]) print " - state:" for s in state: print " * %s : %s" % (s, state[s]) + + # actually do stuff ... + self.dm.onModeChange() self.psmtool.onModeChange() if state['loggedin']: print "\n *** logged in (non-local mode) ***\n" # GUI state changes - if self.dm.user.id != 'admin': - self.removeSpecialMenus(self.dm.user) + if state['currentuserid'] != 'admin': + self.removeSpecialMenus(state['currentuserid']) self.menuBar.Enable(ID_PREF_PROXY, 0) self.menuBar.Enable(ID_PREF_SERVER1, 0) self.menuBar.Enable(ID_PREF_SERVER2, 0) @@ -481,14 +504,12 @@ self.menuBar.Enable(ID_PREF_PASSWD, 1) self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) self.sb.SetServer(''.join(['Repository: ', - self.dm.serverHost, - ':', - self.dm.serverPort])) + state['currentserver']])) self.sb.ShowImage(True) else: print "\n *** not logged in (local mode) ***\n" # GUI state changes - self.addSpecialMenus(self.dm.user) + self.addSpecialMenus(state['currentuserid']) self.menuBar.Enable(ID_FILE_LOGIN, 1) self.menuBar.Enable(ID_PREF_PROXY, 1) self.menuBar.Enable(ID_PREF_SERVER1, 1) @@ -794,45 +815,49 @@ dlg.GetTextctrlPort().SetValue(proxyport) dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: - serverhost = dlg.GetTextctrlHost().GetValue() - port = dlg.GetTextctrlPort().GetValue() - - serverhost.strip() - port.strip() - if serverhost == '' or port == '': + proxyhost = dlg.GetTextctrlHost().GetValue() + proxyport = dlg.GetTextctrlPort().GetValue() + proxyhost.strip() + proxyport.strip() + if proxyhost == '' or proxyport == '': errdlg = wxMessageDialog(self, - "A server and a port are required", - "Unable to comply", - wxOK|wxCENTRE|wxICON_EXCLAMATION) + "A proxy host name or IP and a port are required", + "Unable to comply", + wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() else: - prefs['proxy'] = serverhost + ':' + port + state['proxy'] = proxyhost + ':' + proxyport + prefs['proxy'] = state['proxy'] + def OnServerSettings(self, event): + # TODO: ask if the user wants to use these settings as their + # preference. (TODO: of course we also need a more general prefs + # edit frame ;) dlg = ServerDialog(self, -1, 'Enter Server Information') - serverhost = prefs.get('serverhost', 'localhost') - serverport = prefs.get('port', str(8080)) - - dlg.GetTextctrlHost().SetValue(serverhost) - dlg.GetTextctrlPort().SetValue(serverport) + server = state['currentserver'] + if server: + serverhost, serverport = server.split(':') + dlg.GetTextctrlHost().SetValue(serverhost) + dlg.GetTextctrlPort().SetValue(serverport) dlg.CentreOnParent() if dlg.ShowModal() == wxID_OK: serverhost = dlg.GetTextctrlHost().GetValue() - port = dlg.GetTextctrlPort().GetValue() - + serverport = dlg.GetTextctrlPort().GetValue() serverhost.strip() - port.strip() - if serverhost == '' or port == '': + serverport.strip() + if serverhost == '' or serverport == '': errdlg = wxMessageDialog(self, - "A server and a port are required", - "Unable to comply", - wxOK|wxCENTRE|wxICON_EXCLAMATION) + "A host name or IP and a port are required", + "Unable to comply", + wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() else: - prefs['serverhost'] = serverhost - prefs['port'] = port + state['currentserver'] = ':'.join([serverhost, serverport]) + if state['currentserver'] not in state['serverlist']: + state['serverlist'].insert(0, state['currentserver']) def OnSize(self, event): @@ -920,17 +945,21 @@ def addSpecialMenus(self, user_info): - if self.dm.user.god: - self.AddGodMenu(self.dm.user) - elif self.dm.user.id == "admin": # admin_flag: + if (state['loggedin'] + and state['currentuserid'] == 'admin' + and self.AdminMenu == None): self.AddAdminMenu(self.dm.user) +######### GodMenu is temporarily disabled +# if self.dm.user.god: +# self.AddGodMenu(self.dm.user) def removeSpecialMenus(self, user_info): if not userinfo.id == "admin" and self.AdminMenu: self.RemoveAdminMenu(user_info) - if userinfo.god and self.GodMenu: - self.RemoveGodMenu() +######### GodMenu is temporarily disabled +# if userinfo.god and self.GodMenu: +# self.RemoveGodMenu() def RemoveAdminMenu(self, user_info): @@ -939,7 +968,7 @@ self.AdminMenu = None - def adminMenu(self): + def createAdminMenu(self): adminmenu = wxMenu() adminmenu.Append(ID_ADMIN_SEARCHUSER, "&Find User...", @@ -956,41 +985,45 @@ just to the right of the Options Menu. This only should happen if the user logged in is an administrator. """ - if self.AdminMenu == None: - self.AdminMenu = self.adminMenu() - self.menuBar.Insert(self.SpecialPos, - self.AdminMenu, - "Administrator") - self.menuBar.Refresh() + if (state['loggedin'] + and state['currentuserid'] == 'admin' + and self.AdminMenu == None): + self.AdminMenu = self.createAdminMenu() + self.menuBar.Insert(self.SpecialPos, + self.AdminMenu, + "Administrator") + self.menuBar.Refresh() - def RemoveGodMenu(self, user_info): - self.menuBar.Remove(self.SpecialPos) # the admin menu - self.menuBar.Refresh() - self.GodMenu = None - - - def AddGodMenu(self, user_info): - """ - This method inserts the God menu on the main menubar, - just to the right of the Options Menu. This only should happen - if the user logged in has God access. - """ - if self.GodMenu == None: - self.GodMenu = wxMenu() - self.GodMenu.Append(ID_ADMIN_PASSWD, - "Change &Password...", - "Change Administrator Password") - AdminMenu = self.adminMenu() - self.GodMenu.AppendMenu(ID_SPECIAL_ADMIN, - '&Administrator', - AdminMenu) - self.menuBar.Insert(self.SpecialPos, self.GodMenu, "God") - # self.menuBar.Check(ID_PGDEV_ITEM, 1) - self.menuBar.Refresh() +######### GodMenu is temporarily disabled +# +# def RemoveGodMenu(self, user_info): +# self.menuBar.Remove(self.SpecialPos) # the admin menu +# self.menuBar.Refresh() +# self.GodMenu = None +# +# +# def AddGodMenu(self, user_info): +# """ +# This method inserts the God menu on the main menubar, +# just to the right of the Options Menu. This only should happen +# if the user logged in has God access. +# """ +# if self.GodMenu == None: +# self.GodMenu = wxMenu() +# self.GodMenu.Append(ID_ADMIN_PASSWD, +# "Change &Password...", +# "Change Administrator Password") +# AdminMenu = self.createAdminMenu() +# self.GodMenu.AppendMenu(ID_SPECIAL_ADMIN, +# '&Administrator', +# AdminMenu) +# self.menuBar.Insert(self.SpecialPos, self.GodMenu, "God") +# # self.menuBar.Check(ID_PGDEV_ITEM, 1) +# self.menuBar.Refresh() def OnLogout(self, event): state['loggedin'] = '' - self.OnModeChange() + self.onModeChange() def OnLogin(self, event): @@ -1004,15 +1037,14 @@ dialog.GetCheckboxUseSSL().SetValue(int(self.secure)) dialog.GetRepository().Clear() - serverlist = self.dm.getServerList() - for entry in serverlist: + for entry in state['serverlist']: dialog.GetRepository().Append(entry) - - dialog.GetRepository().SetSelection(0) + i = state['serverlist'].index(state['currentserver']) + dialog.GetRepository().SetSelection(i) dialog.CentreOnParent() - user = prefs.get('userid', None) - if user: - dialog.GetTextctrlUsername().SetValue(user) + userid = prefs.get('userid', None) or state.get('currentuser', '') + dialog.GetTextctrlUsername().SetValue(userid) + if userid: dialog.GetTextctrlPassword().SetFocus() still_trying = True @@ -1032,12 +1064,17 @@ dialog.GetCheckboxConfirmed().GetValue()) self.secure = dialog.GetCheckboxUseSSL().GetValue() hostport = dialog.GetRepository().GetStringSelection() - self.dm.serverHost, self.dm.serverPort = hostport.split(':') - self.dm.user.id = dialog.GetTextctrlUsername().GetValue() - self.dm.user._password = dialog.GetTextctrlPassword().GetValue() - - if self.dm.login(self.dm.user.id, self.dm.user._password, - secure=self.secure): + loginid = dialog.GetTextctrlUsername().GetValue() + loginpasswd = dialog.GetTextctrlPassword().GetValue() + state['currentserver'] = state['serverlist'][ + dialog.GetRepository().GetSelection()] + print ' - loginid: ', loginid + print ' - server: ', state['currentserver'] + if (prefs.get('userid', None) + and loginid == prefs['userid']): + self.dm.user._password = loginpasswd + print 'self.secure: ', self.secure + if self.dm.login(loginid, loginpasswd, secure=self.secure): dlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(400, 75), wxTHICK_FRAME) @@ -1050,7 +1087,8 @@ dialog.Destroy() still_trying = False state['loggedin'] = '1' - self.OnModeChange() + state['currentuserid'] = loginid + self.onModeChange() if prefs.get('ShowLoginConfirmed', None): sdlg = wxMessageDialog(self, "Login successful.", Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.37 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.38 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.37 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Tue Aug 17 11:47:56 2004 @@ -169,7 +169,7 @@ self.Enable(True) wgt = self.GetTextctrlPoc() - wgt.SetValue(state['currentuser']) + wgt.SetValue(state['currentuserid']) wgt.Enable(False) wgt.SetEditable(False) wgt = self.GetTextctrlListversion() Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.151 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.152 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.151 Mon Aug 16 06:14:18 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Tue Aug 17 11:47:56 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.151 2004/08/16 10:14:18 waterbug Exp $ +# $Id: itemeditframe.py,v 1.152 2004/08/17 15:47:56 waterbug Exp $ -__version__ = "$Revision: 1.151 $"[11:-2] +__version__ = "$Revision: 1.152 $"[11:-2] import copy import types @@ -887,10 +887,7 @@ self.ImportPartsListFrame.SetDataManager(self.dm) if state['mode'] != 'local': - self.ImportPartsListFrame.sb.SetServer( - ''.join([self.dm.serverHost, - ':', - self.dm.serverPort])) + self.ImportPartsListFrame.sb.SetServer(state['currentserver']) else: self.ImportPartsListFrame.sb.ClearServer() Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.147 PanGalactic/pangalactic/utils/datamanager.py:1.148 --- PanGalactic/pangalactic/utils/datamanager.py:1.147 Mon Aug 16 16:18:46 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Tue Aug 17 11:47:57 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.147 2004/08/16 20:18:46 waterbug Exp $ +# $Id: datamanager.py,v 1.148 2004/08/17 15:47:57 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.147 $ +@version: $Revision: 1.148 $ """ -__version__ = "$Revision: 1.147 $"[11:-2] +__version__ = "$Revision: 1.148 $"[11:-2] import time import mx.DateTime @@ -69,12 +69,10 @@ except ZODB.POSException.StorageSystemError, e: raise LocalStorageError, "Local Database StorageError" self.domains = domains - self.inLocalMode = True - self.watchdog = watchdog or SecurityManager() - self.watchdog.inLocalMode = self.inLocalMode + # TODO: SecurityManager is cruft -- needs complete rewrite! + self.watchdog = watchdog or SecurityManager( + Person(id=state['currentuserid'])) self.user = self.watchdog.user - self.serverHost = prefs.get('serverhost', 'localhost') - self.serverPort = prefs.get('serverport', '8080') self.server = None self.refresh = False print """Calling DataManager.setCurrentProject('%s')""" % projectid @@ -91,11 +89,48 @@ self.creatingWorkflow = False + def getServerHost(self): + return state['currentserver'].split(':')[0] + + def setServerHost(self): + raise ValueError, 'serverHost is not settable' + + def delServerHost(self): + raise ValueError, 'serverHost is not deletable' + + serverHost = property(getServerHost, setServerHost, + delServerHost, 'serverHost') + + def getServerPort(self): + return state['currentserver'].split(':')[1] + + def setServerPort(self): + raise ValueError, 'serverPort is not settable' + + def delServerPort(self): + raise ValueError, 'serverPort is not deletable' + + serverPort = property(getServerPort, setServerPort, + delServerPort, 'serverPort') + + def onModeChange(self, event=None): + """ + Trigger DataManager local/remote-mode adjustments. + """ + if state['loggedin']: + print "DataManager.onModeChange (loggedin)" + # nothing here yet ... login() does it all + else: + print "DataManager.onModeChange (local)" + self.server = None + + def _createServer(self, username, password, secure=1): """ Initialize a server proxy. """ # TODO: implement HTTP proxy handling + print 'DM._createServer creating XmlrpcInterface' proxyhost = prefs.get('proxyhost', None) proxyport = prefs.get('proxyport', None) return XmlrpcInterface(self.serverHost, @@ -146,26 +181,28 @@ def getDisplayConfig(self): return self.localDB.getDisplayConfig() + def setDisplayConfig(self, config): self.localDB.setDisplayConfig(config) - def getServerList(self): - return [':'.join([self.serverHost, self.serverPort])] - def getRoles(self): return self.localDB.getDict(self.localDB.ROLE) + def saveRoles(self, roles): # print "dm.saveroles" self.localDB.SaveRoles(roles) + def getUser(self, userid): return self.localDB.getUser(self.localDB.USER, userid) + def saveUser(self, user): self.localDB.SaveUser(user) + def newObject(self, classname): """ Create a new object with the current project as its 'project' @@ -214,29 +251,25 @@ return obj - def login(self, username, password, secure=1): + def login(self, userid, password, secure=1): """ Oversees the login process and the loading of roles and project data. """ # print "datamanager.login" - self.server = self._createServer(username, password, secure=secure) + self.server = self._createServer(userid, password, secure=secure) try: self.server.yo() except xmlrpclib.ProtocolError, e: print "Exception: datamanager.login", e return False - self.inLocalMode = False - self.watchdog.inLocalMode = False - prefs['userid'] = username - self.watchdog.user = Person(id=username) - self.watchdog.user._password = password + self.watchdog.user = Person(id=state['currentuserid']) print "NOTE: create tmp role - GDA. Remove RSN" tmp_roles = [] tmp_role = PgefRole() tmp_role.RoleCode = 'GDA' - tmp_role.Userid = username - tmp_role.id = username + tmp_role.Userid = userid + tmp_role.id = userid tmp_role.project = 'H2G2' tmp_roles.append(tmp_role) @@ -753,6 +786,7 @@ def approveUser(self, user_info): print "dm.approve", user_info.email self.server.approveUser(user_info) + def requestUser(self, user_info): print "dm.requestuser" Index: PanGalactic/pangalactic/client/modules/plm/epimsmapping.py diff -u PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.13 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.14 --- PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.13 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/plm/epimsmapping.py Tue Aug 17 11:47:55 2004 @@ -52,9 +52,7 @@ self.SelectedRow = None if state['loggedin']: - self.sb.SetServer(''.join([self.dm.serverHost, - ':', - self.dm.serverPort]) + self.sb.SetServer(state['currentserver']) else: self.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.24 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.25 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.24 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Tue Aug 17 11:47:55 2004 @@ -642,10 +642,7 @@ if self.dm: if state['loggedin']: - self.EpimsMappingFrame.sb.SetServer( - ''.join([self.dm.serverHost, - ':', - self.dm.serverPort])) + self.EpimsMappingFrame.sb.SetServer(state['currentserver']) else: self.EpimsMappingFrame.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.12 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.13 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.12 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Tue Aug 17 11:47:56 2004 @@ -162,7 +162,7 @@ self.clearForm() self.Enable(True) self.CreatingModel = True - self.GetPoc().SetValue(state['currentuser']) + self.GetPoc().SetValue(state['currentuserid']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.26 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.27 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.26 Thu Aug 12 13:30:05 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Tue Aug 17 11:47:56 2004 @@ -3,6 +3,7 @@ from otherdoc_wdr import * from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions #import pangalactic.enterprise.document as document @@ -211,7 +212,7 @@ self.ClearForm() self.Enable(True) ctrl = self.GetAuthorWgt() - ctrl.SetValue(self.State.currentuser) + ctrl.SetValue(state['currentuserid']) ctrl = self.GetVersionWgt() ctrl.SetValue("1") Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.38 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.39 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.38 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Tue Aug 17 11:47:56 2004 @@ -22,7 +22,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.38 $"[11:-2] +__version__ = "$Revision: 1.39 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -204,18 +204,20 @@ self.ClosingPLMtool = False try: defsize = wxSize(800, 500) - self.ImportPartsListFrame = toolframe.toolFrame(self, -1, - "Import Parts List Data", - wxDefaultPosition, defsize) - self.ImportPartsListFrame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') - self.ImportPartsListFrame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") + self.ImportPartsListFrame = toolframe.toolFrame( + self, -1, + "Import Parts List Data", + wxDefaultPosition, defsize) + self.ImportPartsListFrame.menuBar.SetLabel( + toolframe.ID_FILE_EXIT, + '&Close') + self.ImportPartsListFrame.menuBar.SetHelpString( + toolframe.ID_FILE_EXIT, + "Close this window") self.ImportPartsListFrame.SetDataManager(self.dm) - if state['mode'] != 'local': - self.ImportPartsListFrame.sb.SetServer( - ''.join([self.dm.serverHost, - ':', - self.dm.serverPort])) + if state['loggedin']: + self.ImportPartsListFrame.sb.SetServer(state['currentserver']) else: self.ImportPartsListFrame.sb.ClearServer() @@ -224,12 +226,14 @@ wxDefaultPosition, defsize) self.PLMtool.SetColumnInfo(self.currentdocument._ColumnInfo, - self.partslistview.partslistgrid.GetNumberCols()) + self.partslistview.partslistgrid.GetNumberCols()) self.ImportPartsListFrame.CentreOnParent() self.ImportPartsListFrame.Show(True) - EVT_CLOSE(self.ImportPartsListFrame, self.OnCloseImportPartsListFrame) - EVT_MENU(self.ImportPartsListFrame, PLM_FILE_CLOSE_ITEM, self.OnCloseImportPartsListFrame) + EVT_CLOSE(self.ImportPartsListFrame, + self.OnCloseImportPartsListFrame) + EVT_MENU(self.ImportPartsListFrame, + PLM_FILE_CLOSE_ITEM, self.OnCloseImportPartsListFrame) if not self.PLMtool.onSelectSource(): self.OnCloseImportPartsListFrame() Index: PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.29 PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.30 --- PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.29 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py Tue Aug 17 11:47:56 2004 @@ -1,5 +1,6 @@ from wxPython.wx import wxTreeCtrl, wxTreeItemIcon_Selected -import pangalactic.utils.objectstatus as objectstatus +from pangalactic.utils import objectstatus +from pangalactic.utils.pgefstate import state import pgefedittree @@ -75,7 +76,6 @@ PdrNodes = [] highlightednode = None - localmode = datamanager.inLocalMode localpdrs = datamanager.getPartDocLinksByProjectId(datamanager.CurrentProject.id) #print "num localpdrs", len(localpdrs) @@ -85,15 +85,14 @@ PdrNodes.append(pdrobj.pgef_oid) datamanager.refresh = False else: - if localmode: + if state['loggedin']: + if datamanager.pdrIDs.has_key(lookupid): + PdrNodes = datamanager.pdrIDs[lookupid] + else: for pdrid, pdrobj in localpdrs.items(): if pdrobj.product == lookupid and pdrobj.state <> objectstatus.DELETE: PdrNodes.append(pdrobj.pgef_oid) - else: - if datamanager.pdrIDs.has_key(lookupid): - PdrNodes = datamanager.pdrIDs[lookupid] - childcount = 0 for id in PdrNodes: pdrobj = datamanager.getLookupObject(id) @@ -159,7 +158,6 @@ PdrNodes = [] highlightednode = None - localmode = datamanager.inLocalMode localpdrs = datamanager.getPartDocLinksByProjectId(datamanager.CurrentProject.id) if datamanager.refresh: for pdrid, pdrobj in localpdrs.items(): @@ -170,20 +168,19 @@ datamanager.refresh = False else: - if localmode: - #print "localmode" + if state['loggedin']: + print "PgefDocTree: in remote mode" + if datamanager.pdrIDs.has_key(lookupid): + PdrNodes = datamanager.pdrIDs[lookupid] + #else: + # print "logged in; no match for ItemID", ItemID + else: + print "PgefDocTree: in local mode" for pdrid, pdrobj in localpdrs.items(): #print "checking: " + pdrobj.pgef_oid + "; state: " + repr(pdrobj.state) if pdrobj.product == lookupid and pdrobj.state <> objectstatus.DELETE: #print "appending", pdrobj.document PdrNodes.append(pdrobj.pgef_oid) - - else: - #print "not local" - if datamanager.pdrIDs.has_key(lookupid): - PdrNodes = datamanager.pdrIDs[lookupid] - #else: - # print "logged in; no match for ItemID", ItemID childcount = 0 #print "numnodes: " + str(len(PdrNodes)) Index: PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.21 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.22 --- PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.21 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py Tue Aug 17 11:47:56 2004 @@ -56,7 +56,7 @@ ## #print "found lookupid" ## PdrNodes = datamanager.pdrIDs[lookupid] -## elif datamanager.inLocalMode: +## elif not state['loggedin']: ## for pdrid, pdrobj in datamanager.getDocPartLinks().items(): ## if pdrobj.pgef_oid == rootitemid: ## PdrNodes.append(pdrid) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.178 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.179 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.178 Mon Aug 16 15:32:34 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Tue Aug 17 11:47:56 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.178 2004/08/16 19:32:34 pbear Exp $ +# $Id: psmtool.py,v 1.179 2004/08/17 15:47:56 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.178 $"[11:-2] +__version__ = "$Revision: 1.179 $"[11:-2] import os @@ -564,10 +564,7 @@ self.itemeditform.Show(True) if state['loggedin']: - self.itemeditform.sb.SetServer( - ''.join([self.dm.serverHost, - ':', - self.dm.serverPort])) + self.itemeditform.sb.SetServer(state['currentserver']) else: self.itemeditform.sb.ClearServer() @@ -679,7 +676,7 @@ if len(objectlist) == 0: return - if not self.inLocalMode(): + if state['loggedin']: savedlg = wxDialog(self, -1, "A Message from PGEF", wxDefaultPosition, wxSize(300, 75), wxTHICK_FRAME) @@ -747,7 +744,7 @@ # self.dm.setCurrentProject(state['currentprojectname']) treetuple = self.tree.GetPyData(node) obj = self.dm.getLookupObject(treetuple[1]) - if not self.inLocalMode(): + if state['loggedin']: linkedobjs = self.dm.getNAUOByAssemblyID([obj.pgef_oid]) linkedobjs = self.dm.getLocalAcusByAssemblyID( @@ -844,7 +841,7 @@ def CheckForUncommittedData(self, closing = False): print "PSMTool.CheckForUncommittedData" - if self.dm.inLocalMode: + if not state['loggedin']: print "Why check for uncommitted data in local mode???" return @@ -1108,16 +1105,13 @@ wgt.SetSelection(0) - def inLocalMode(self): - return self.dm.inLocalMode - def ClearTreeAndGrid(self): self.tree.DeleteAllItems() def onModeChange(self, event=None): """ - Trigger PSMTool local/remote-dependent interface adjustments. + Trigger PSMTool local/remote-mode interface adjustments. """ if state['loggedin']: print "PSMTool.onModeChange (loggedin)" @@ -1127,7 +1121,6 @@ self.tree.DeleteAllItems() self.itemgrid.ClearGrid() self.modelgrid.ClearGrid() - state['currentuser'] = self.dm.user.id self.OnSelectProject() else: print "PSMTool.onModeChange (local)" Index: PanGalactic/pangalactic/utils/pgefstate.py diff -u PanGalactic/pangalactic/utils/pgefstate.py:1.4 PanGalactic/pangalactic/utils/pgefstate.py:1.5 --- PanGalactic/pangalactic/utils/pgefstate.py:1.4 Thu Aug 12 15:46:16 2004 +++ PanGalactic/pangalactic/utils/pgefstate.py Tue Aug 17 11:47:57 2004 @@ -1,12 +1,13 @@ -# $Id: pgefstate.py,v 1.4 2004/08/12 19:46:16 waterbug Exp $ +# $Id: pgefstate.py,v 1.5 2004/08/17 15:47:57 waterbug Exp $ """ Global state for a PGEF application -@version: $Revision: 1.4 $ +@version: $Revision: 1.5 $ """ -__version__ = "$Revision: 1.4 $"[11:-2] +__version__ = "$Revision: 1.5 $"[11:-2] +from pangalactic.utils.utils import unique StateFilename = 'state.cfg' fileread = 0 @@ -14,25 +15,42 @@ def readState(refresh=0): """ - Read state from the state file. + Read state from the state file, in which each line has the form + 'name ~ value'. The state is represented by a Python dictionary (the + global 'state' variable) of the form {name : value, ...}. States with + multiple values are permitted, but they *must* have a name that + contains the string 'list'. For multi-valued states, the values will + be represented as a list: {name : [v1, v2, ...], ...} @param refresh: if true, forces a read even if file has been read """ global fileread if not fileread or refresh: + statelist = [] try: for line in file(StateFilename): - key, value = line.split(' ~ ') - state[key] = value.strip() + name, value = line.split(' ~ ') + statelist.append([name.strip(), value.strip()]) except: statefile = open(StateFilename,'w') statefile.close() - + names = unique([s[0] for s in statelist]) + for n in names: + values = [s[1] for s in filter( + lambda x: x[0] == n, statelist)] + if n.find('list') > -1: + state[n] = values + else: + state[n] = values[0] fileread = 1 def writeState(): fo = open(StateFilename, 'w') for p in state: - fo.write(p + ' ~ ' + str(state[p]) + '\n') + if type(state[p]) is list: + for item in state[p]: + fo.write(p + ' ~ ' + str(item) + '\n') + else: + fo.write(p + ' ~ ' + str(state[p]) + '\n') fo.close() Index: PanGalactic/pangalactic/utils/securitymanager.py diff -u PanGalactic/pangalactic/utils/securitymanager.py:1.11 PanGalactic/pangalactic/utils/securitymanager.py:1.12 --- PanGalactic/pangalactic/utils/securitymanager.py:1.11 Tue Aug 10 12:13:41 2004 +++ PanGalactic/pangalactic/utils/securitymanager.py Tue Aug 17 11:47:57 2004 @@ -1,13 +1,14 @@ -# $Id: securitymanager.py,v 1.11 2004/08/10 16:13:41 waterbug Exp $ +# $Id: securitymanager.py,v 1.12 2004/08/17 15:47:57 waterbug Exp $ """ Manager of security permissions for PanGalaxian. -@version: $Revision: 1.11 $ +@version: $Revision: 1.12 $ """ -__version__ = "$Revision: 1.11 $"[11:-2] +__version__ = "$Revision: 1.12 $"[11:-2] from pangalactic.enterprise.person import Person +from pangalactic.utils.pgefstate import state class Roles: def __init__(self): @@ -26,7 +27,7 @@ class Action: def __init__(self): - + self.ADDALL = 20 self.ADDITEM = 21 self.ADDPDR = 22 @@ -40,29 +41,29 @@ self.MODIFYDOCUMENT = 13 self.MODIFYNAUO = 14 self.MODIFYPARTSLIST = 15 - + self.DELETEALL = 30 self.DELETEITEM = 31 self.DELETEPDR = 32 self.DELETEDOCUMENT = 33 self.DELETENAUO = 34 self.DELETEPARTSLIST = 35 - + self.LINKALL = 40 self.LINKITEM = 41 self.LINKDOCUMENT = 42 self.LINKPARTSLIST = 44 - + self.VIEWALL = 50 self.VIEWITEM = 51 self.VIEWPDR = 52 self.VIEWDOCUMENT = 53 self.VIEWNAUO = 54 self.VIEWPARTSLIST = 55 - + self.ACCESSALERTS = 60 - - + + actions = Action() action_role_xref = {roles.GDA : [actions.ADDALL, @@ -98,34 +99,29 @@ actions.VIEWALL], roles.GU : [actions.VIEWALL] } - + class SecurityManager: """ Manager of security permissions for PanGalaxian. """ - def __init__(self, user=None, inLocalMode=True): + def __init__(self, user=None): """ Initialize a Security Manager instance. @param user: a Person object representing the user @type user: L{pangalactic.enterprise.person.Person} - - @param inLocalMode: indicates whether the parent data manager is in - local mode - @type inLocalMode: bool """ self._Roles = None self.user = user or Person(pgef_oid='test', id='test') - self.inLocalMode = inLocalMode self.RejectedList = [] def setRoles(self, roles): self.user.comp_role_bit_mask = {} temp = {} - + for role in roles: if temp.has_key(role.RoleCode): templist = temp[role.RoleCode] @@ -137,7 +133,7 @@ self.user.comp_role_bit_mask = temp self._Roles = temp - + def GetRoles(self, project): currentrole = [] if self._Roles: @@ -146,17 +142,17 @@ currentrole.append(role) return currentrole else: - if self.inLocalMode: + if not state['loggedin']: return [roles.GDA] # change if roles are enforced locally def GetActions(self, project): actions = [] myroles = self.GetRoles(project) - + if roles.P in myroles: actions = action_role_xref[roles.P][:] - + if roles.PDA in myroles: actions = action_role_xref[roles.PDA][:] @@ -171,21 +167,21 @@ #actions = action_role_xref[roles.PDA][:] #uncomment the following line to simulate being a global data admin #actions = action_role_xref[roles.GDA][:] - + #print 'actions are <%s>' % repr(actions) return actions - - + + def AuthorizeAction(self, project, action, object = None): if self.Roles.has_key('GDA'): return True - + role = self.GetRole(project) if 'PDA' in role: return True if 'G' in role and len(role) == 1: return False - + if object: if 'P' in role: if action == objectstatus.DELETE or action == objectstatus.MODIFY: @@ -195,7 +191,7 @@ return True else: return False - + if object.type == 'Alert': if ('ADA' in role or 'GC' in role): return True @@ -205,13 +201,13 @@ return False if 'A' in role: return False - + if ('FAM' in role and len(role) == 1): return False - + def CanRetrieveAlerts(self): if ('ADA' in role or 'GC' in role or 'A' in role or 'CS' in role): return True else: return False - + From waterbug at ned.gsfc.nasa.gov Tue Aug 17 13:35:32 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 17 13:35:34 2004 Subject: [Pangalactic-commits] Use registry onto_classes to create tables. Message-ID: <200408171735.i7HHZWnq002020@ned.gsfc.nasa.gov> Modified files: PanGalactic/admin/createPgerDbTables_chronos.py None 1.1 Log message: Use registry onto_classes to create tables. From waterbug at ned.gsfc.nasa.gov Tue Aug 17 14:24:14 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 17 14:24:16 2004 Subject: [Pangalactic-commits] Move createPgerDbTables_chronos.py in with other db stuff. Message-ID: <200408171824.i7HIOEBl010928@ned.gsfc.nasa.gov> Modified files: PanGalactic/admin/createPgerDbTables_chronos.py 1.1 None PanGalactic/src/sql/createPgerDbTables_chronos.py None 1.1 Log message: Move createPgerDbTables_chronos.py in with other db stuff. From waterbug at ned.gsfc.nasa.gov Wed Aug 18 00:42:52 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 00:42:54 2004 Subject: [Pangalactic-commits] Arg! This was a 5-line module! Added PgefMainTree into pgeftree module. Message-ID: <200408180442.i7I4gqGH016374@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/pgefmaintree.py 1.5 None Log message: Arg! This was a 5-line module! Added PgefMainTree into pgeftree module. From waterbug at ned.gsfc.nasa.gov Wed Aug 18 01:41:49 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 01:41:51 2004 Subject: [Pangalactic-commits] Mainly, slight reorg of PSMTool.changeProject() ... Message-ID: <200408180541.i7I5fnxN016507@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/pgeftree.py 1.40 1.41 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.179 1.180 PanGalactic/pangalactic/test/IDTEST 1.51 1.52 Log message: Mainly, slight reorg of PSMTool.changeProject() ... PanGalaxian seemed to get into slightly strange states with repeated login/logout cycling to different hosts. This change *seemed* to fix it ... we need to test more. Index: PanGalactic/pangalactic/client/modules/psm/pgeftree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.40 PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.40 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgeftree.py Wed Aug 18 01:41:47 2004 @@ -1,4 +1,11 @@ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/pgeftree.py,v $ +# $Id: pgeftree.py,v 1.41 2004/08/18 05:41:47 waterbug Exp $ +""" +Base class for PanGalaxian's trees + +@version: $Revision: 1.41 $ +""" +__version__ = "$Revision: 1.41 $"[11:-2] + import cPickle, types from wxPython.wx import wxTreeCtrl, wxImageList, EVT_MOTION, EVT_LEFT_DOWN @@ -6,24 +13,22 @@ from wxPython.wx import wxNewId, wxMenu, wxCustomDataObject from wxPython.wx import wxCustomDataFormat, wxDropSource, wxID_OK -import pangalactic.utils.objectstatus as objectstatus -import pangalactic.utils.ToolkitImages as ToolkitImages - -from pangalactic.utils import pgefevents -from pangalactic.utils import pdfoptions -from pangalactic.utils.pgefstate import state - -import pangalactic.client.modules.psm.itemdroptarget as itemdroptarget -import pangalactic.client.io.treereport as treereport +from pangalactic.utils import objectstatus +from pangalactic.utils import ToolkitImages +from pangalactic.utils import pdfoptions +from pangalactic.utils import pgefevents +from pangalactic.utils.pgefstate import state +from pangalactic.client.modules.psm import itemdroptarget +from pangalactic.client.io import treereport -__version__ = "$Revision: 1.40 $"[11:-2] +__version__ = "$Revision: 1.41 $"[11:-2] class PgefTree(wxTreeCtrl): """ subclassed treecontrol shamelessly pilfered from the wxPython demo, although the XML functionality has been moved to a mixin Class """ - def __init__(self, parent, ID, datamanager = None, allowdragndrop = True): + def __init__(self, parent, ID, datamanager=None, allowdragndrop=True): wxTreeCtrl.__init__(self, parent, ID) self.dm = datamanager self.Parent = parent @@ -123,10 +128,12 @@ dropSource.DoDragDrop(True) - def LoadTreefromObjects(self, dm, rootobj, parentnode=None): #AssemblyID, rootnode = None, currentdata = None): - """Loads the tree from the dicts in the DataManager""" - #print "pgeftree.loadtreefromobjects" - + def LoadTreefromObjects(self, dm, rootobj, parentnode=None): + """ + Load the tree from the dicts in the DataManager + """ + print "PgefTree.LoadTreefromObjects" + print " - rootobj.pgef_oid =", rootobj.pgef_oid AcuIds = [] if parentnode: @@ -142,7 +149,7 @@ self.SetPyData(rootnode,[acu_id, rootobj.pgef_oid]) if state['loggedin']: - #print "getting more acus" + print " - getting more acus from server ..." dm.getNAUOByAssemblyID([rootobj.pgef_oid]) localacus = dm.getLocalAcus(dm.CurrentProject) @@ -150,6 +157,7 @@ if acuobj.assembly == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: AcuIds.append(acuid) + print ' - AcuIds: ', AcuIds for acuid in AcuIds: acuobj = dm.getLookupObject(acuid) itemobj = dm.getLookupObject(acuobj.component) @@ -234,9 +242,11 @@ return returnlist - - - - - - +class PgefMainTree(PgefTree): + """ + The base panel tree for PanGalaxian + """ + def __init__(self, parent, ID, datamanager=None): + PgefTree.__init__(self, parent, ID, datamanager, False) + + Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.179 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.180 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.179 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Wed Aug 18 01:41:47 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.179 2004/08/17 15:47:56 waterbug Exp $ +# $Id: psmtool.py,v 1.180 2004/08/18 05:41:47 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.179 $"[11:-2] +__version__ = "$Revision: 1.180 $"[11:-2] import os @@ -46,7 +46,7 @@ from pangalactic.client.support import httpdownload from pangalactic.client.modules.psm import toolbarpanel from pangalactic.client.modules.psm import searchframe -from pangalactic.client.modules.psm import pgefmaintree +from pangalactic.client.modules.psm import pgeftree from pangalactic.client.modules.psm import pgefversiontree from pangalactic.client.modules.psm import mystuffoptions from pangalactic.client.modules.psm import projectframe @@ -211,9 +211,9 @@ wxSize(200, 200)) self.tID = wxNewId() self.treeMap = {} - self.tree = pgefmaintree.PgefMainTree(self.tree_notebook, - self.tID, - self.dm) + self.tree = pgeftree.PgefMainTree(self.tree_notebook, + self.tID, + self.dm) self.tree.SetBackgroundColour(wxWHITE) tree_tooltip = """A hierarchy of the currently selected part. Click on a part to highlight its data in the Parts grid. @@ -309,6 +309,10 @@ def synchGridSelections(self, obj): + """ + Synchronize the item selected in the table grid with the item + selected in the Component selection widget. + """ print "PSMTool.synchGridSelections" objclass = obj.__class__.__name__ @@ -603,7 +607,7 @@ foo.Show(True) - def OnGridToPdf(self, event = None): + def OnGridToPdf(self, event=None): currentgrid = self.GetCurrentGrid() # sometimes the grid has one empty row nrows = currentgrid.GetNumberRows() @@ -620,7 +624,7 @@ - def OnSearchItems(self, event = None): + def OnSearchItems(self, event=None): if not self.SearchFrame: self.SearchFrame = searchframe.SearchFrame(self, -1, 'Search', datamanager=self.dm) @@ -631,7 +635,7 @@ self.CloseSearchFrame) self.SearchFrame.Show(True) - def CloseSearchFrame (self, event = None): + def CloseSearchFrame (self, event=None): if self.SearchFrame: self.SearchFrame.Show(False) self.SearchFrame = None @@ -871,7 +875,7 @@ - def OnItemClick(self, event = None): + def OnItemClick(self, event=None): print "PSMTool.OnItemClick" ndx = self.topWindow.toppanel.GetItemWidget().GetSelection() if ndx == 0: @@ -906,7 +910,7 @@ print "end onitemclick" - def OnSelectProject(self, event = None): + def OnSelectProject(self, event=None): print "PSMTool.OnSelectProject" wgt = self.topWindow.toppanel.GetProjectWidget() selection = wgt.GetStringSelection() @@ -927,12 +931,14 @@ print "project ndx", projectname, ndx if self.itemeditform: self.itemeditform.SecureMode() - state['lastproject'] = projectname + state['currentprojectname'] = projectname + self.dm.setCurrentProject(projectname) wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) dlg = None + wxSafeYield() + wxBeginBusyCursor() if state['loggedin']: - wxBeginBusyCursor() try: self.topWindow.toppanel.GetItemWidget().SetFocus() dlg = wxDialog(self, -1, @@ -945,44 +951,27 @@ wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) - state['currentprojectname'] = projectname self.dm.getItemsByProject([projectname]) - self.tree.DeleteAllItems() - numitems = self.FillGridFromProject(projectname) - self.FillItemWidgetFromProject(projectname) - if numitems > 0: - wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') - self.Parent.menuBar.Enable(wgt, True) - self.UpdateWindows() if dlg: dlg.Destroy() self.SecureMenu() except: if dlg: dlg.Destroy() - wxEndBusyCursor() - - else: - wxSafeYield() - wxBeginBusyCursor() - self.itemgrid.ClearGrid() - self.modelgrid.ClearGrid() - self.tree.DeleteAllItems() - ndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() - if ndx > 0: - projectname = self.topWindow.toppanel.GetProjectWidget( - ).GetStringSelection() - state['currentprojectname'] = projectname - numitems = self.FillGridFromProject(projectname) - self.FillItemWidgetFromProject(projectname) - if numitems > 0: - wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') - self.Parent.menuBar.Enable(wgt, True) - self.UpdateWindows() - self.SecureMenu() - wxEndBusyCursor() - if ndx > 0: - self.dm.setCurrentProject(projectname) + self.itemgrid.ClearGrid() + self.modelgrid.ClearGrid() + self.tree.DeleteAllItems() + ndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() + projectname = self.topWindow.toppanel.GetProjectWidget( + ).GetStringSelection() + numitems = self.FillGridFromProject(projectname) + self.FillItemWidgetFromProject(projectname) + if numitems > 0: + wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') + self.Parent.menuBar.Enable(wgt, True) + self.UpdateWindows() + self.SecureMenu() + wxEndBusyCursor() print "end PSMTool.changeProject" def UpdateWindows(self): Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.51 PanGalactic/pangalactic/test/IDTEST:1.52 --- PanGalactic/pangalactic/test/IDTEST:1.51 Mon Aug 9 14:18:18 2004 +++ PanGalactic/pangalactic/test/IDTEST Wed Aug 18 01:41:48 2004 @@ -1 +1 @@ -836 \ No newline at end of file +846 \ No newline at end of file From waterbug at ned.gsfc.nasa.gov Wed Aug 18 02:44:20 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 02:44:22 2004 Subject: [Pangalactic-commits] Hmmm ... how to make PSMTool's grids aware of column customizations ...? Message-ID: <200408180644.i7I6iKf4017001@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.5 1.6 PanGalactic/pangalactic/utils/dbbrowser.py 1.27 1.28 Log message: Hmmm ... how to make PSMTool's grids aware of column customizations ...? Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.5 PanGalactic/pangalactic/client/pangalaxian.py:1.6 --- PanGalactic/pangalactic/client/pangalaxian.py:1.5 Tue Aug 17 11:47:55 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Wed Aug 18 02:44:18 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.5 2004/08/17 15:47:55 waterbug Exp $ +# $Id: pangalaxian.py,v 1.6 2004/08/18 06:44:18 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.5 $ +@version: $Revision: 1.6 $ """ -__version__ = "$Revision: 1.5 $"[11:-2] +__version__ = "$Revision: 1.6 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -369,23 +369,33 @@ tb.Realize() def CreateMenu(self): - """ Encapsulates the code that creates the menu and adds the menu items. Note that - there are dynamically added menus. Admin is added at position 3, Tool menus - are added directly to the left of the Help menu.""" + """ + Create the menu and add its items. Note that there are dynamically + added menus. Admin is added at position 3, Tool menus are added + directly to the left of the Help menu. + """ self.menuBar = wxMenuBar() submenu = wxMenu() submenu.Append(ID_FILE_NEWPART, '&Part...', "Create a new part") submenu.Append(ID_FILE_NEWMODEL, '&Model...', "Create a new model") - submenu.Append(ID_FILE_NEWPARTSLIST, '&Parts List...', "Create a new parts list") - submenu.Append(ID_FILE_NEWDOCUMENT, '&Document...', "Create a new document") + submenu.Append(ID_FILE_NEWPARTSLIST, + '&Parts List...', + "Create a new parts list") + submenu.Append(ID_FILE_NEWDOCUMENT, + '&Document...', + "Create a new document") menu = wxMenu() menu.AppendMenu(ID_FILE_NEW, '&New', submenu) submenu = wxMenu() - submenu.Append(ID_FILE_EXPORT_PROPERTIES, "&Properties...", "Export properties to a spreadsheet") - submenu.Append(ID_TOOL_GRIDTOPDF, "&Table Data...", "Export grid data to a PDF file") + submenu.Append(ID_FILE_EXPORT_PROPERTIES, + "&Properties...", + "Export properties to a spreadsheet") + submenu.Append(ID_TOOL_GRIDTOPDF, + "&Table Data...", + "Export grid data to a PDF file") menu.AppendMenu(ID_FILE_EXPORT, "&Export", submenu) menu.Enable(ID_FILE_EXPORT, False) @@ -399,7 +409,9 @@ menu = wxMenu() menu.Append(ID_TOOL_SEARCH, "&Search...", "Search the database") menu.Enable(ID_TOOL_SEARCH, False) - menu.Append(ID_TOOL_DBBROWSER, "&Browse Local Database...", "Browse the local database dictionaries") + menu.Append(ID_TOOL_DBBROWSER, + "&Browse Local Database...", + "Browse the local database dictionaries") menu.AppendSeparator() docmenu = wxMenu() @@ -416,17 +428,27 @@ self.menuBar.Append(menu, "&Tools") menu = wxMenu() - menu.Append(ID_FILE_COMMIT, "&Commit Changes", "Commit changes to database") + menu.Append(ID_FILE_COMMIT, + "&Commit Changes", + "Commit changes to database") menu.Enable(ID_FILE_COMMIT, False) - menu.Append(ID_TOOL_GETMYSTUFF, "&View My Stuff...", "View anything that's mine") + menu.Append(ID_TOOL_GETMYSTUFF, + "&View My Stuff...", + "View anything that's mine") menu.Enable(ID_TOOL_GETMYSTUFF, False) - menu.Append(ID_PREF_SERVER1, '&Repository...', 'What repository do I use?') + menu.Append(ID_PREF_SERVER1, + '&Repository...', + 'What repository do I use?') self.menuBar.Append(menu, "&Repository") # Cache menu menu = wxMenu() - menu.Append(ID_PREF_CLEAR_LOCALDB, '&Clear Local Database', 'Clear locally stored data') - menu.Append(ID_TOOL_DBBROWSER, "&Browse Local Database...", "Browse the local database dictionaries") + menu.Append(ID_PREF_CLEAR_LOCALDB, + '&Clear Local Database', + 'Clear locally stored data') + menu.Append(ID_TOOL_DBBROWSER, + "&Browse Local Database...", + "Browse the local database dictionaries") self.menuBar.Append(menu, "&Cache") submenu = wxMenu() Index: PanGalactic/pangalactic/utils/dbbrowser.py diff -u PanGalactic/pangalactic/utils/dbbrowser.py:1.27 PanGalactic/pangalactic/utils/dbbrowser.py:1.28 --- PanGalactic/pangalactic/utils/dbbrowser.py:1.27 Mon Aug 16 14:03:00 2004 +++ PanGalactic/pangalactic/utils/dbbrowser.py Wed Aug 18 02:44:19 2004 @@ -1,10 +1,15 @@ #!/bin/env python +# $Id: dbbrowser.py,v 1.28 2004/08/18 06:44:19 waterbug Exp $ #---------------------------------------------------------------------------- # Name: dbbrowser.py -# Author: XXXX -# Created: XX/XX/XX -# Copyright: +# Author: Ginny #---------------------------------------------------------------------------- +""" +PanGalactic object browser for ZODB + +@version: $Revision: 1.28 $ +""" +__version__ = "$Revision: 1.28 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -15,11 +20,11 @@ import types -import pangalactic.utils.toolframe as toolframe -import pangalactic.utils.objectviewer as objectviewer -import pangalactic.utils.configuregrid as configuregrid -import pangalactic.utils.localdb as localdb - +from pangalactic.utils import toolframe +from pangalactic.utils import objectviewer +from pangalactic.utils import configuregrid +from pangalactic.utils import localdb +from pangalactic.utils.pgefstate import state from pangalactic.utils.dbbrowser_wdr import * from pangalactic.enterprise.pgefobject import PgefObject @@ -38,8 +43,8 @@ RightClickMenuOptions = [] def __init__(self, parent, id, localdb, - pos = wxDefaultPosition, size = wxDefaultSize): - wxPanel.__init__(self, parent, id, pos, size, style = wxTHICK_FRAME) + pos=wxDefaultPosition, size=wxDefaultSize): + wxPanel.__init__(self, parent, id, pos, size, style=wxTHICK_FRAME) self.Parent = parent self.localDB = localdb self.dbfile = None @@ -108,6 +113,12 @@ def OnClose(self, event): + if getattr(self.Parent, 'Parent'): + # hmm ... this isn't working ... ask Ginny how to make + # psmtool's grids aware of column customizations + print 'dbbrowser parent:', self.Parent.Parent + proj = state['currentprojectname'] + self.Parent.Parent.psmtool.FillGridFromProject(proj) self.Parent.Close() @@ -115,7 +126,7 @@ self.ClearGrid() self.FillGrid() - + def SetDBFile(self, file = None): if file: self.dbfile = file @@ -140,10 +151,11 @@ 'Customize DataBase Browser', wxDefaultPosition, tmpsize) - cfg_frame.mainpanel = configuregrid.ConfigureGrid(cfg_frame, -1, - localdb = self.localDB, - collection_name = collection_name, - current_config = self.current_config) + cfg_frame.mainpanel = configuregrid.ConfigureGrid( + cfg_frame, -1, + localdb = self.localDB, + collection_name = collection_name, + current_config = self.current_config) cfg_frame.CentreOnParent() cfg_frame.Show(True) From waterbug at ned.gsfc.nasa.gov Wed Aug 18 11:52:51 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 11:52:54 2004 Subject: [Pangalactic-commits] Squashing some minor bugs. Message-ID: <200408181552.i7IFqpfH021869@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/docform.py 1.8 1.9 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.39 1.40 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.152 1.153 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.13 1.14 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.27 1.28 PanGalactic/pangalactic/client/modules/psm/partform.py 1.13 1.14 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.38 1.39 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.39 1.40 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.180 1.181 PanGalactic/pangalactic/enterprise/pgefobject.py 1.67 1.68 PanGalactic/pangalactic/repo/chronosynclastic.py 1.1 1.2 PanGalactic/pangalactic/utils/datamanager.py 1.148 1.149 Log message: Squashing some minor bugs. Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.8 PanGalactic/pangalactic/client/modules/psm/docform.py:1.9 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.8 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Wed Aug 18 11:52:47 2004 @@ -3,7 +3,7 @@ from wxPython.wx import * from pangalactic.client.modules.psm.docform_wdr import * -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions Index: PanGalactic/pangalactic/repo/chronosynclastic.py diff -u PanGalactic/pangalactic/repo/chronosynclastic.py:1.1 PanGalactic/pangalactic/repo/chronosynclastic.py:1.2 --- PanGalactic/pangalactic/repo/chronosynclastic.py:1.1 Sun Aug 8 22:22:57 2004 +++ PanGalactic/pangalactic/repo/chronosynclastic.py Wed Aug 18 11:52:48 2004 @@ -1,10 +1,10 @@ -# $Id: chronosynclastic.py,v 1.1 2004/08/09 02:22:57 waterbug Exp $ +# $Id: chronosynclastic.py,v 1.2 2004/08/18 15:52:48 waterbug Exp $ """ The Chronosynclastic Infundibulum: an asynchronous, ontology-driven object-relational mapping and database interface. -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ The following convention must be followed: for PGEF enterprise objects (L{pangalactic.enterprise.pgefobject.PgefObject} and its @@ -12,7 +12,7 @@ lower-case. """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] import imp import re @@ -54,7 +54,6 @@ def __init__(self, - #dbapiname='pyPgSQL.PgSQL', dbapiname='psycopg', database='pgerdb', domains='PanGalactic', Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.39 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.39 Fri Aug 13 02:43:20 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Wed Aug 18 11:52:47 2004 @@ -15,9 +15,9 @@ from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils import objectstatus -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.27 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.28 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.27 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Wed Aug 18 11:52:47 2004 @@ -2,7 +2,7 @@ from wxPython.wx import * from otherdoc_wdr import * -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions @@ -10,7 +10,8 @@ class OtherDocForm(wxPanel, Security_Mixin): def __init__(self, parent, id, state, delmode = True, debu = 0, - pos = wxPyDefaultPosition, size = wxPyDefaultSize, style = wxTAB_TRAVERSAL): + pos = wxPyDefaultPosition, size = wxPyDefaultSize, + style = wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent self.State = state Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.13 PanGalactic/pangalactic/client/modules/psm/partform.py:1.14 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.13 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Wed Aug 18 11:52:47 2004 @@ -4,7 +4,7 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.partform_wdr import * Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.67 PanGalactic/pangalactic/enterprise/pgefobject.py:1.68 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.67 Mon Aug 16 06:14:18 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Wed Aug 18 11:52:48 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.67 2004/08/16 10:14:18 waterbug Exp $ +# $Id: pgefobject.py,v 1.68 2004/08/18 15:52:48 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.67 $ +@version: $Revision: 1.68 $ """ -__version__ = "$Revision: 1.67 $"[11:-2] +__version__ = "$Revision: 1.68 $"[11:-2] import types import string @@ -607,7 +607,7 @@ RequiredDataError. """ required = [p.id for p in filter( - lambda x: bool(getattr(p, 'min_cardinality', 0)), + lambda x: bool(getattr(x, 'min_cardinality', 0)), self._schema.properties)] for a in required: val = getattr(self, a, None) Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.152 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.153 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.152 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Wed Aug 18 11:52:47 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.152 2004/08/17 15:47:56 waterbug Exp $ +# $Id: itemeditframe.py,v 1.153 2004/08/18 15:52:47 waterbug Exp $ -__version__ = "$Revision: 1.152 $"[11:-2] +__version__ = "$Revision: 1.153 $"[11:-2] import copy import types @@ -20,7 +20,7 @@ from pangalactic.client.modules.psm import pgefversiontree from pangalactic.utils import objectstatus -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.utils import toolframe from pangalactic.utils.pgefexceptions import RequiredDataError Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.38 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.39 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.38 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Wed Aug 18 11:52:48 2004 @@ -1,13 +1,12 @@ +# $Id: partslistform.py,v 1.39 2004/08/18 15:52:48 waterbug Exp $ + +__version__ = "$Revision: 1.39 $"[11:-2] + from wxPython.wx import wxPanel, wxTAB_TRAVERSAL, wxPyTypeCast, wxPyDefaultPosition, wxPyDefaultSize from wxPython.wx import wxFileDialog from partslistform_wdr import * from pangalactic.utils.pgefstate import state - - -#import pangalactic.enterprise.partslist as partslist -#import dataobjects.item - -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.13 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.14 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.13 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Wed Aug 18 11:52:47 2004 @@ -3,7 +3,7 @@ from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.modelform_wdr import * Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.39 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.39 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Wed Aug 18 11:52:48 2004 @@ -8,7 +8,7 @@ from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError from pangalactic.utils.pgefstate import state -from pangalactic.utils.preferences import prefs +from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.client.modules.psm import partslistview from pangalactic.client.modules.psm import partslistform from pangalactic.client.modules.psm import pgefdoctree @@ -22,7 +22,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.180 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.181 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.180 Wed Aug 18 01:41:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Wed Aug 18 11:52:48 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.180 2004/08/18 05:41:47 waterbug Exp $ +# $Id: psmtool.py,v 1.181 2004/08/18 15:52:48 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.180 $"[11:-2] +__version__ = "$Revision: 1.181 $"[11:-2] import os @@ -695,7 +695,6 @@ objlist = objectlist if len(objlist) > 0: self.dm.setCurrentProject(state['currentprojectname']) - self.dm.setState(state) retval = self.dm.commit(objlist) # change the grid background colour to the default colour Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.148 PanGalactic/pangalactic/utils/datamanager.py:1.149 --- PanGalactic/pangalactic/utils/datamanager.py:1.148 Tue Aug 17 11:47:57 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Wed Aug 18 11:52:49 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.148 2004/08/17 15:47:57 waterbug Exp $ +# $Id: datamanager.py,v 1.149 2004/08/18 15:52:49 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.148 $ +@version: $Revision: 1.149 $ """ -__version__ = "$Revision: 1.148 $"[11:-2] +__version__ = "$Revision: 1.149 $"[11:-2] import time import mx.DateTime @@ -145,8 +145,10 @@ def getRoot(self): return self.localDB.dbroot + def getPasswd(self, pwd_id): return self.localDB.getPasswd(pwd_id) + def changePassword(self, login_pwd, new_pwd, userid="", secure=1): # print "update local passwds" From waterbug at ned.gsfc.nasa.gov Wed Aug 18 12:07:21 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 12:07:23 2004 Subject: [Pangalactic-commits] Small oops. Message-ID: <200408181607.i7IG7LBG022070@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/cagesearchframe.py 1.3 1.4 Log message: Small oops. Index: PanGalactic/pangalactic/utils/cagesearchframe.py diff -u PanGalactic/pangalactic/utils/cagesearchframe.py:1.3 PanGalactic/pangalactic/utils/cagesearchframe.py:1.4 --- PanGalactic/pangalactic/utils/cagesearchframe.py:1.3 Sat Aug 14 19:54:44 2004 +++ PanGalactic/pangalactic/utils/cagesearchframe.py Wed Aug 18 12:07:20 2004 @@ -1,4 +1,4 @@ -from wxPython.wx from * +from wxPython.wx import * from pangalactic.utils import cagesearchgui from pangalactic.utils import orggrid From waterbug at ned.gsfc.nasa.gov Wed Aug 18 19:39:11 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 18 19:39:13 2004 Subject: [Pangalactic-commits] Small stuff; no need for ndx here. Message-ID: <200408182339.i7INdBdS029776@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.181 1.182 PanGalactic/pangalactic/utils/basegrid.py 1.35 1.36 PanGalactic/pangalactic/utils/dbbrowser.py 1.28 1.29 Log message: Small stuff; no need for ndx here. Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.181 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.182 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.181 Wed Aug 18 11:52:48 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Wed Aug 18 19:39:09 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.181 2004/08/18 15:52:48 waterbug Exp $ +# $Id: psmtool.py,v 1.182 2004/08/18 23:39:09 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.181 $"[11:-2] +__version__ = "$Revision: 1.182 $"[11:-2] import os @@ -882,7 +882,7 @@ projndx = wgt.GetSelection() project = wgt.GetString(projndx) # overkill, but it works for now. vwk - self.changeProject(ndx, project) + self.changeProject(project) return else: ndx -= 1 @@ -922,12 +922,12 @@ # self.dm.setCurrentProject(project) # ndx = wgt.GetSelection() # if ndx > 0: - self.changeProject(ndx, selection) + self.changeProject(selection) - def changeProject(self, ndx, projectname): + def changeProject(self, projectname): print "PSMTool.changeProject" - print "project ndx", projectname, ndx + print "project", projectname if self.itemeditform: self.itemeditform.SecureMode() state['currentprojectname'] = projectname @@ -960,7 +960,6 @@ self.itemgrid.ClearGrid() self.modelgrid.ClearGrid() self.tree.DeleteAllItems() - ndx = self.topWindow.toppanel.GetProjectWidget().GetSelection() projectname = self.topWindow.toppanel.GetProjectWidget( ).GetStringSelection() numitems = self.FillGridFromProject(projectname) @@ -1120,7 +1119,7 @@ wgt = self.topWindow.toppanel.GetProjectWidget() ndx = wgt.GetSelection() projectname = wgt.GetStringSelection() - self.changeProject(ndx, projectname) + self.changeProject(projectname) def BuildTree(self, itemid): Index: PanGalactic/pangalactic/utils/basegrid.py diff -u PanGalactic/pangalactic/utils/basegrid.py:1.35 PanGalactic/pangalactic/utils/basegrid.py:1.36 --- PanGalactic/pangalactic/utils/basegrid.py:1.35 Wed Aug 11 13:44:30 2004 +++ PanGalactic/pangalactic/utils/basegrid.py Wed Aug 18 19:39:09 2004 @@ -1,13 +1,13 @@ -# $Id: basegrid.py,v 1.35 2004/08/11 17:44:30 waterbug Exp $ +# $Id: basegrid.py,v 1.36 2004/08/18 23:39:09 waterbug Exp $ """ Wrapper for the grid that adds the drag and drop functionality to the base grid class. Also adds the ability to set the labels for the grid columns and to fill a row of data given the data in a list format -@version: $Revision: 1.35 $ +@version: $Revision: 1.36 $ """ -__version__ = "$Revision: 1.35 $"[11:-2] +__version__ = "$Revision: 1.36 $"[11:-2] import cPickle import os @@ -413,7 +413,9 @@ def ConfigGrid(self, event = None): #print "basegrid.configgrid" tmpsize = wxSize(750, 500) - gridframe = wxDialog(self, -1, "Customize Grid Layout", wxDefaultPosition, tmpsize, + gridframe = wxDialog(self, -1, + "Customize Grid Layout", + wxDefaultPosition, tmpsize, style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME ) if not len(self.table._data) > 0: Index: PanGalactic/pangalactic/utils/dbbrowser.py diff -u PanGalactic/pangalactic/utils/dbbrowser.py:1.28 PanGalactic/pangalactic/utils/dbbrowser.py:1.29 --- PanGalactic/pangalactic/utils/dbbrowser.py:1.28 Wed Aug 18 02:44:19 2004 +++ PanGalactic/pangalactic/utils/dbbrowser.py Wed Aug 18 19:39:10 2004 @@ -1,5 +1,5 @@ #!/bin/env python -# $Id: dbbrowser.py,v 1.28 2004/08/18 06:44:19 waterbug Exp $ +# $Id: dbbrowser.py,v 1.29 2004/08/18 23:39:10 waterbug Exp $ #---------------------------------------------------------------------------- # Name: dbbrowser.py # Author: Ginny @@ -7,9 +7,9 @@ """ PanGalactic object browser for ZODB -@version: $Revision: 1.28 $ +@version: $Revision: 1.29 $ """ -__version__ = "$Revision: 1.28 $"[11:-2] +__version__ = "$Revision: 1.29 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -117,8 +117,7 @@ # hmm ... this isn't working ... ask Ginny how to make # psmtool's grids aware of column customizations print 'dbbrowser parent:', self.Parent.Parent - proj = state['currentprojectname'] - self.Parent.Parent.psmtool.FillGridFromProject(proj) + self.Parent.Parent.psmtool.onModeChange() self.Parent.Close() @@ -169,14 +168,18 @@ cfg_frame.setHelpData(app_title = "Customize DataBase Browser", help_text = htext) new_helpmenu = wxMenu() - new_helpmenu.Append(toolframe.ID_HELP_CONTENTS, "&Contents...", "General information") + new_helpmenu.Append(toolframe.ID_HELP_CONTENTS, + "&Contents...", + "General information") old_helpmenu = \ cfg_frame.GetMenuBar().Replace(cfg_frame.GetMenuBar().GetMenuCount() - 1, new_helpmenu, "&Help") old_helpmenu = None else: - errdlg = wxMessageDialog(self, "Select an entry from the list.", "No Entry Selected", + errdlg = wxMessageDialog(self, + "Select an entry from the list.", + "No Entry Selected", wxOK|wxCENTRE|wxICON_EXCLAMATION) errdlg.CentreOnParent() errdlg.ShowModal() From waterbug at ned.gsfc.nasa.gov Thu Aug 19 10:14:00 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 19 10:14:03 2004 Subject: [Pangalactic-commits] import pgefstate in these guys. Message-ID: <200408191414.i7JEE0sH002451@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/doctreeframe.py 1.25 1.26 PanGalactic/pangalactic/client/modules/psm/treeframe.py 1.10 1.11 PanGalactic/pangalactic/utils/toolframe.py 1.7 1.8 Log message: import pgefstate in these guys. Index: PanGalactic/pangalactic/client/modules/psm/doctreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.25 PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.26 --- PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.25 Mon May 17 09:49:30 2004 +++ PanGalactic/pangalactic/client/modules/psm/doctreeframe.py Thu Aug 19 10:13:58 2004 @@ -1,4 +1,4 @@ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/doctreeframe.py,v $ +# $Id: doctreeframe.py,v 1.26 2004/08/19 14:13:58 waterbug Exp $ import types import copy @@ -6,16 +6,15 @@ from wxPython.wx import * from wxPython.grid import * -import pangalactic.enterprise.document as document - +from pangalactic.client.modules.psm import pgefdoctree +from pangalactic.client.modules.psm import treeframe +from pangalactic.enterprise import document from pangalactic.utils.pgefexceptions import RequiredDataError -import pangalactic.utils.basegrid as basegrid -import pangalactic.utils.ToolkitImages as ToolkitImages - -import pangalactic.client.modules.psm.pgefdoctree as pgefdoctree -import pangalactic.client.modules.psm.treeframe as treeframe +from pangalactic.utils.pgefstate import state +from pangalactic.utils import basegrid +from pangalactic.utils import ToolkitImages -__version__ = "$Revision: 1.25 $"[11:-2] +__version__ = "$Revision: 1.26 $"[11:-2] NEW_MODE = 1 @@ -27,8 +26,8 @@ DOCUMENT = "document" PARTS_LIST = "parts_list" - def __init__(self, parent, state, datamanager): - treeframe.TreeFrame.__init__(self, parent, state, datamanager) + def __init__(self, parent, datamanager): + treeframe.TreeFrame.__init__(self, parent, datamanager) self.creatingDocument = False self.EditMode = False @@ -102,7 +101,7 @@ self.creatingDocument = True def SecureMode(self): - actions = self.Parent.WatchDog.GetActions(self.State.currentprojectname) + actions = self.Parent.WatchDog.GetActions(state['currentprojectname']) self.docform.SetAllowed(actions) def RootMode(self): Index: PanGalactic/pangalactic/client/modules/psm/treeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/treeframe.py:1.10 PanGalactic/pangalactic/client/modules/psm/treeframe.py:1.11 --- PanGalactic/pangalactic/client/modules/psm/treeframe.py:1.10 Mon Jun 7 15:37:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/treeframe.py Thu Aug 19 10:13:58 2004 @@ -9,12 +9,11 @@ class TreeFrame(toolframe.toolFrame): - def __init__(self, parent, state, datamanager): + def __init__(self, parent, datamanager): toolframe.toolFrame.__init__(self, parent, -1, "Create a Document", wxDefaultPosition, wxSize(800, 600)) self.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") self.CentreOnParent() - self.State = state self.Parent = parent if datamanager: Index: PanGalactic/pangalactic/utils/toolframe.py diff -u PanGalactic/pangalactic/utils/toolframe.py:1.7 PanGalactic/pangalactic/utils/toolframe.py:1.8 --- PanGalactic/pangalactic/utils/toolframe.py:1.7 Mon Jun 7 15:37:31 2004 +++ PanGalactic/pangalactic/utils/toolframe.py Thu Aug 19 10:13:59 2004 @@ -59,7 +59,7 @@ self.SetStatusText(" Server: ", 2) -class toolFrame(wxFrame): +class toolFrame(wxFrame): def __init__(self, parent, ID, title, pos = wxDefaultPosition, size = wxDefaultSize, From waterbug at ned.gsfc.nasa.gov Thu Aug 19 17:49:14 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 19 17:49:16 2004 Subject: [Pangalactic-commits] Updates to INSTALL Message-ID: <200408192149.i7JLnEIC010150@ned.gsfc.nasa.gov> Modified files: PanGalactic/INSTALL 1.12 1.13 Log message: Updates to INSTALL Index: PanGalactic/INSTALL diff -u PanGalactic/INSTALL:1.12 PanGalactic/INSTALL:1.13 --- PanGalactic/INSTALL:1.12 Mon May 3 15:12:28 2004 +++ PanGalactic/INSTALL Thu Aug 19 17:49:13 2004 @@ -14,7 +14,7 @@ ;^) Recommended OS for the PGEF Repository Server: - - RedHat Linux v7.2 or better + - Linux (Development platform is Fedora Core) Configuration Options: Do NOT install the bundled version of PostgreSQL. It is an older version than what was used to develop the PGEF @@ -32,9 +32,10 @@ All of the following software is free and open source. + (1) Required for All PGEF Configurations: - - Python (version 2.3.2 or greater is recommended; 2.2.3 at minimum) + - Python (version 2.3 or greater is required) http://python.org Configuration: Python has several binary installers for various platforms and can also be compiled and installed from @@ -45,33 +46,31 @@ - Twisted [latest stable release] http://twistedmatrix.com - Configuration: Twisted installs very easily using the - standard Python package installation procedures (setup.py). + Configuration: Twisted installs very easily using standard Python + package installation procedures (setup.py) on Unices and their + Windows installer on M$win platforms. - OpenSSL http://www.openssl.org - [more later] - -(2) Required for the PGEF Client: + Configuration: see that site for installation procedures. - The items in (1), except... - - Python 2.3.3 is strongly recommeneded to avoid massive deprecation warnings. +(2) Required for the PGEF Client: - and ... + The items in (1) *plus* the following packages ... - wxPython 2.4.2.4 http://wxpython.org - Configuration: wxPython has excellent installation - and configuration instructions on its Web site. - - - ReportLab (1.18) + Configuration: wxPython has excellent installation and configuration + instructions for all platforms on its Web site. + + - ReportLab 1.18 or greater http://www.reportlab.org - + - Python Imaging Library (PIL) (latest released version) http://www.pythonware.com/products/pil - - Zope Object Database (ZODB) (3.1 or better) + - Zope Object Database (ZODB) (latest stable release is recommended) http://www.zope.org/Products/StandaloneZODB - Win32 COM Extensions @@ -91,13 +90,16 @@ environment variables LC_COLLATE and LC_CTYPE to 'C', so that PostgreSQL will be able to use its indexes in LIKE and regexp queries (see PostgreSQL admin docs for more info). - + - pyPgSQL (version 2.4 is recommended; 2.3 or better is required) http://pypgsql.sourceforge.net - + - mxDateTime (latest released version) http://www.egenix.com/files/python/eGenix-mx-Extensions.html#Download-mxBASE - + + - Redland RDF Application Framework + http://www.redland.opensource.ac.uk + - Express Engine* (latest released version) http://exp-engine.sourceforge.net Configuration Options: @@ -228,4 +230,4 @@ twistd -f pger.tap ----------------------------------------------------------------- -$Id: INSTALL,v 1.12 2004/05/03 19:12:28 pbear Exp $ +$Id: INSTALL,v 1.13 2004/08/19 21:49:13 waterbug Exp $ From waterbug at ned.gsfc.nasa.gov Fri Aug 20 01:28:13 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 20 01:28:14 2004 Subject: [Pangalactic-commits] Not used anywhere. Message-ID: <200408200528.i7K5SD9T012360@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/datepanel.py 1.6 None Log message: Not used anywhere. From waterbug at ned.gsfc.nasa.gov Fri Aug 20 01:31:13 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 20 01:31:15 2004 Subject: [Pangalactic-commits] Die, half-baked security crap! Message-ID: <200408200531.i7K5VDKL012411@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/__init__.py 1.10 1.11 PanGalactic/pangalactic/utils/datetimes.py 1.3 1.4 PanGalactic/pangalactic/utils/mixin_security.py 1.4 None Log message: Die, half-baked security crap! Index: PanGalactic/pangalactic/utils/__init__.py diff -u PanGalactic/pangalactic/utils/__init__.py:1.10 PanGalactic/pangalactic/utils/__init__.py:1.11 --- PanGalactic/pangalactic/utils/__init__.py:1.10 Fri Apr 16 14:32:58 2004 +++ PanGalactic/pangalactic/utils/__init__.py Fri Aug 20 01:31:12 2004 @@ -3,13 +3,13 @@ "aboutbox_gui", "acrobat5", "acrobatwrapper", -"reportfonts", "basegrid", "convertimage", "configuregrid", "configuredisplay", "customizegrid_gui", "datamanager", +"datetimes", "dbbrowser", "dbbrowser_wdr", "factory", @@ -18,7 +18,6 @@ "loginform_wdr", "mappinggrid", "mappinggrid_wdr", -"mixin_security", "objectreport", "objectstatus", "oid", @@ -34,6 +33,7 @@ "proxydialog_wdr", "pystrptime", "registry", +"reportfonts", "reportlab_blocks", "securitymanager", "serverclass", Index: PanGalactic/pangalactic/utils/datetimes.py diff -u PanGalactic/pangalactic/utils/datetimes.py:1.3 PanGalactic/pangalactic/utils/datetimes.py:1.4 --- PanGalactic/pangalactic/utils/datetimes.py:1.3 Fri Mar 5 16:18:15 2004 +++ PanGalactic/pangalactic/utils/datetimes.py Fri Aug 20 01:31:12 2004 @@ -1,10 +1,12 @@ """ PGEF date-time convenience functions. + +@version: $Revision: 1.4 $ """ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/utils/datetimes.py,v $ +# $Id: datetimes.py,v 1.4 2004/08/20 05:31:12 waterbug Exp $ -__version__ = "$Revision: 1.3 $"[11:-2] +__version__ = "$Revision: 1.4 $"[11:-2] import time from mx import DateTime From waterbug at ned.gsfc.nasa.gov Fri Aug 20 02:11:27 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 20 02:11:30 2004 Subject: [Pangalactic-commits] Minor fixes of cruft-removal side-effects. Message-ID: <200408200611.i7K6BR1n012524@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/docform.py 1.9 1.10 PanGalactic/pangalactic/client/modules/psm/doctreeframe.py 1.26 1.27 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.153 1.154 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.14 1.15 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.28 1.29 PanGalactic/pangalactic/client/modules/psm/partform.py 1.14 1.15 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.39 1.40 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.182 1.183 PanGalactic/pangalactic/enterprise/pgefobject.py 1.68 1.69 PanGalactic/pangalactic/utils/__init__.py 1.11 1.12 Log message: Minor fixes of cruft-removal side-effects. Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.182 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.183 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.182 Wed Aug 18 19:39:09 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Fri Aug 20 02:11:25 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.182 2004/08/18 23:39:09 waterbug Exp $ +# $Id: psmtool.py,v 1.183 2004/08/20 06:11:25 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.182 $"[11:-2] +__version__ = "$Revision: 1.183 $"[11:-2] import os @@ -39,8 +39,6 @@ from pangalactic.utils.pgefstate import state from pangalactic.utils import pgdialogs from pangalactic.utils import ToolkitImages -from pangalactic.utils.mixin_security import Security_Mixin -from pangalactic.utils.securitymanager import actions from pangalactic.utils import basegrid from pangalactic.client.support import httpdownload @@ -92,7 +90,7 @@ return PSMTool(parent, datamgr, ID, pos, wxSize(1,1)) -class PSMTool(wxPanel, Security_Mixin): +class PSMTool(wxPanel): """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. @@ -490,31 +488,12 @@ def SecureMenu(self): project = self.topWindow.toppanel.GetProjectWidget( ).GetStringSelection() - self.AllowedActions = self.Parent.WatchDog.GetActions(project) - - if self.Allowed(actions.ADDALL): - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWPART, True) - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWMODEL, True) - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) - else: - if self.Allowed(actions.ADDITEM): - pass - else: - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWPART, False) - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWMODEL, False) - if self.Allowed(actions.ADDPARTSLIST): - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) - else: - self.Parent.menuBar.Enable( - sys.modules['__main__'].ID_FILE_NEWPARTSLIST, False) - if not self.Allowed(actions.DELETEITEM): - pass + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPART, True) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWMODEL, True) + self.Parent.menuBar.Enable( + sys.modules['__main__'].ID_FILE_NEWPARTSLIST, True) def rebuildMainTree(self): @@ -592,7 +571,6 @@ print "PSMTool.OnNewPartsList" print "currentproject", state['currentprojectname'] foo = PartsListTreeFrame(self.Parent, self.dm) - foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() foo.Show(True) @@ -601,7 +579,6 @@ def OnNewDoc(self): print "PSMTool.OnNewDoc", state['currentprojectname'] foo = DocumentTreeFrame(self.Parent, self.dm) - foo.SecureMode() foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() foo.Show(True) @@ -928,8 +905,6 @@ def changeProject(self, projectname): print "PSMTool.changeProject" print "project", projectname - if self.itemeditform: - self.itemeditform.SecureMode() state['currentprojectname'] = projectname self.dm.setCurrentProject(projectname) wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.9 PanGalactic/pangalactic/client/modules/psm/docform.py:1.10 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.9 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Fri Aug 20 02:11:25 2004 @@ -5,11 +5,10 @@ from pangalactic.client.modules.psm.docform_wdr import * from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state -from pangalactic.utils.mixin_security import Security_Mixin from pangalactic.utils.securitymanager import actions -class DocForm(wxPanel, Security_Mixin): +class DocForm(wxPanel): def __init__(self, parent, id, delmode=True, debug=0, pos=wxPyDefaultPosition, size=wxPyDefaultSize, style=wxTAB_TRAVERSAL): @@ -122,18 +121,7 @@ button = wxPyTypeCast(self.FindWindowById(DOC_CANCEL_BUTTON), "wxButton") button.Enable(True) - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - pass - - if not self.Allowed(actions.MODIFYDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(DOC_SAVE_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(DOC_CANCEL_BUTTON), "wxButton") - button.Enable(False) - + def LinkMode(self): #print "docform.linkmode" self.Enable(False) @@ -146,18 +134,7 @@ button.Enable(False) button = wxPyTypeCast(self.FindWindowById(DOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(DOC_NEW_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(DOC_EDIT_BUTTON), "wxButton") - button.Enable(False) - - if not self.Allowed(actions.MODIFYDOCUMENT): - pass + def RootMode(self): #print "docform.rootmode" @@ -170,18 +147,6 @@ button.Enable(False) button = wxPyTypeCast(self.FindWindowById(DOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(DOC_NEW_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(DOC_EDIT_BUTTON), "wxButton") - button.Enable(False) - - if not self.Allowed(actions.MODIFYDOCUMENT): - pass def NodeMode(self): @@ -196,13 +161,6 @@ button = wxPyTypeCast(self.FindWindowById(DOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - if not self.Allowed(actions.DELETEDOCUMENT): - self.enableDeleteWgt(True) - if not self.Allowed(actions.ADDDOCUMENT): - pass - if not self.Allowed(actions.MODIFYDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(DOC_EDIT_BUTTON), "wxButton") - button.Enable(False) def CreatingMode(self): #print "docform.creatingmode" @@ -281,4 +239,4 @@ self.GetFilenameWgt().SetValue(fdlg.GetPath()) fdlg.Destroy() - + Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.28 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.29 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.28 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Fri Aug 20 02:11:25 2004 @@ -4,11 +4,9 @@ from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state -from pangalactic.utils.mixin_security import Security_Mixin -from pangalactic.utils.securitymanager import actions #import pangalactic.enterprise.document as document -class OtherDocForm(wxPanel, Security_Mixin): +class OtherDocForm(wxPanel): def __init__(self, parent, id, state, delmode = True, debu = 0, pos = wxPyDefaultPosition, size = wxPyDefaultSize, style = wxTAB_TRAVERSAL): @@ -124,19 +122,8 @@ button.Enable(True) button = wxPyTypeCast(self.FindWindowById(OTHERDOC_CANCEL_BUTTON), "wxButton") button.Enable(True) + - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - pass - - if not self.Allowed(actions.MODIFYDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_SAVE_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_CANCEL_BUTTON), "wxButton") - button.Enable(False) - def LinkMode(self): #print "otherdocform.linkmode" self.Enable(False) @@ -149,18 +136,7 @@ button.Enable(False) button = wxPyTypeCast(self.FindWindowById(OTHERDOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_NEW_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_EDIT_BUTTON), "wxButton") - button.Enable(False) - - if not self.Allowed(actions.MODIFYDOCUMENT): - pass + def RootMode(self): #print "otherdocform.rootmode" @@ -173,18 +149,6 @@ button.Enable(False) button = wxPyTypeCast(self.FindWindowById(OTHERDOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - - if not self.Allowed(actions.DELETEDOCUMENT): - pass - - if not self.Allowed(actions.ADDDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_NEW_BUTTON), "wxButton") - button.Enable(False) - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_EDIT_BUTTON), "wxButton") - button.Enable(False) - - if not self.Allowed(actions.MODIFYDOCUMENT): - pass def NodeMode(self): @@ -199,13 +163,6 @@ button = wxPyTypeCast(self.FindWindowById(OTHERDOC_CANCEL_BUTTON), "wxButton") button.Enable(False) - if not self.Allowed(actions.DELETEDOCUMENT): - self.enableDeleteWgt(True) - if not self.Allowed(actions.ADDDOCUMENT): - pass - if not self.Allowed(actions.MODIFYDOCUMENT): - button = wxPyTypeCast(self.FindWindowById(OTHERDOC_EDIT_BUTTON), "wxButton") - button.Enable(False) def CreatingMode(self): #print "otherdocform.creatingmode" Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.14 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.15 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.14 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Fri Aug 20 02:11:25 2004 @@ -1,15 +1,13 @@ import os from wxPython.wx import * -from pangalactic.utils.mixin_security import Security_Mixin -from pangalactic.utils.securitymanager import actions from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.modelform_wdr import * - -class ModelForm(wxPanel, Security_Mixin): + +class ModelForm(wxPanel): def __init__(self, parent, id, pos=wxPyDefaultPosition, size=wxPyDefaultSize, @@ -19,11 +17,11 @@ self.CreatingModel = False self.EditingModel = False self.temp_model = None - + self.NextId = None - + Model_Func(self, True) - + def GetCloseWgt(self): return wxPyTypeCast(self.FindWindowById(ID_MODEL_CLOSE), "wxButton") @@ -60,7 +58,7 @@ def getBrowseWgt(self): return wxPyTypeCast(self.FindWindowById(MODEL_BROWSE_BUTTON), "wxButton") - + def getFilenameWgt(self): return wxPyTypeCast(self.FindWindowById(MODEL_FILENAME_TEXTCTRL), "wxTextCtrl") @@ -85,7 +83,7 @@ prefs["nextid"] = self.NextId #print "nextid", self.NextId - + def Enable(self, state): self.GetDesc().SetEditable(state) self.GetIdentifier().SetEditable(state) @@ -94,8 +92,8 @@ self.GetPoc().SetEditable(state) self.getBrowseWgt().Enable(state) self.getFilenameWgt().SetEditable(state) - - + + def BrowseMode(self, gotroot): self.Enable(False) self.CreatingModel = False @@ -104,18 +102,18 @@ self.RootMode() else: self.NodeMode() - - + + def HighlightFirstWgt(self): #print "highlight model" self.GetIdentifier().SetFocus() - + def EditingMode(self): #print "modelform.model.editingmode" self.Enable(True) self.EditingModel = True self.CreatingModel = False - + self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) self.GetNewWgt().Enable(False) @@ -125,38 +123,25 @@ self.HighlightFirstWgt() - + def RootMode(self): self.GetCloseWgt().Enable(True) self.GetSaveWgt().Enable(False) self.GetDeleteWgt().Enable(False) self.GetResetWgt().Enable(False) + self.GetNewWgt().Enable(True) + self.GetEditWgt().Enable(True) - if self.Allowed(actions.ADDITEM): - self.GetNewWgt().Enable(True) - else: - self.GetNewWgt().Enable(False) - - if self.Allowed(actions.MODIFYITEM): - self.GetEditWgt().Enable(True) - else: - self.GetEditWgt().Enable(False) - - def NodeMode(self): self.GetCloseWgt().Enable(True) self.GetSaveWgt().Enable(False) self.GetNewWgt().Enable(False) self.GetEditWgt().Enable(False) self.GetResetWgt().Enable(False) - - if self.Allowed(actions.DELETEITEM): - self.GetDeleteWgt().Enable(True) - else: - self.GetDeleteWgt().Enable(False) + self.GetDeleteWgt().Enable(True) + - def CreatingMode(self): #print "modelform.model.creatingmode" self.clearForm() @@ -172,7 +157,7 @@ self.GetResetWgt().Enable(True) self.HighlightFirstWgt() - + def fillForm(self, modelobj): if modelobj == None: self.temp_model = None @@ -183,8 +168,8 @@ self.GetNomenclature().SetValue(modelobj.description) self.GetDesc().SetValue(modelobj.comment) self.temp_model = modelobj - - + + def fillObject(self, modelobj): modelobj.id = self.GetIdentifier().GetValue() modelobj.name = self.GetName().GetValue() @@ -193,7 +178,7 @@ modelobj.comment = self.GetDesc().GetValue() modelobj._upload_file_name = self.getFilename() return modelobj - + def clearForm(self): """ @@ -207,8 +192,8 @@ self.GetDesc().SetValue("") self.getFilenameWgt().SetValue("") self.temp_model = None - - + + def ResetForm(self, modelobj): #print "modelform.resetmodelform" self.clearForm() @@ -226,12 +211,12 @@ #print "nextid", nextid self.NextId = None - + def Save(self, model_obj): self.fillObject(model_obj) self.NextId = None - + Index: PanGalactic/pangalactic/client/modules/psm/doctreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.26 PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.27 --- PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.26 Thu Aug 19 10:13:58 2004 +++ PanGalactic/pangalactic/client/modules/psm/doctreeframe.py Fri Aug 20 02:11:25 2004 @@ -1,4 +1,4 @@ -# $Id: doctreeframe.py,v 1.26 2004/08/19 14:13:58 waterbug Exp $ +# $Id: doctreeframe.py,v 1.27 2004/08/20 06:11:25 waterbug Exp $ import types import copy @@ -14,7 +14,7 @@ from pangalactic.utils import basegrid from pangalactic.utils import ToolkitImages -__version__ = "$Revision: 1.26 $"[11:-2] +__version__ = "$Revision: 1.27 $"[11:-2] NEW_MODE = 1 @@ -100,10 +100,6 @@ self.docform.CreatingMode() self.creatingDocument = True - def SecureMode(self): - actions = self.Parent.WatchDog.GetActions(state['currentprojectname']) - self.docform.SetAllowed(actions) - def RootMode(self): self.docform.RootMode() Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.153 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.154 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.153 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Fri Aug 20 02:11:25 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.153 2004/08/18 15:52:47 waterbug Exp $ +# $Id: itemeditframe.py,v 1.154 2004/08/20 06:11:25 waterbug Exp $ -__version__ = "$Revision: 1.153 $"[11:-2] +__version__ = "$Revision: 1.154 $"[11:-2] import copy import types @@ -24,7 +24,6 @@ from pangalactic.utils.pgefstate import state from pangalactic.utils import toolframe from pangalactic.utils.pgefexceptions import RequiredDataError -from pangalactic.utils.securitymanager import actions as security_actions try: from pangalactic.client.modules.plm.plmtool import * @@ -53,17 +52,17 @@ self.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") self.CentreOnParent() - + self.Parent = parent if datamanager: self.SetDataManager(datamanager) else: raise RequiredDataError, "A datamanager instance is required" - + self.editingtab = None - + self.vsplitter = wxSplitterWindow(self, -1) - + #create the notebook self.nbid = wxNewId() self.editnb = wxNotebook(self.vsplitter, self.nbid) @@ -81,7 +80,7 @@ self.modeltree = None self.partslisttree = None self.doctree = None - + self.partform = partform.PartForm(self.editnb, -1) self.editnb.AddPage(self.partform, "Part") @@ -107,7 +106,7 @@ self.PartsListPage = 3 self.PartDataPage = 4 self.DocPage = 5 - + self.tabnames = {self.PartPage: 'Part', self.ModelPage: 'Model', self.PropertiesPage: 'Part Properties', @@ -126,7 +125,7 @@ self.dm.creatingModel = False self.dm.creatingDocument = False self.dm.creatingPartsList = False - + self.vsplitter.SetMinimumPaneSize(20) self.vsplitter.SplitVertically(self.tree, self.editnb, 220) @@ -152,7 +151,7 @@ EVT_BUTTON(self, docform.DOC_CANCEL_BUTTON, self.OnResetDoc) EVT_BUTTON(self, docform.DOC_CLOSE_BUTTON, self.OnClose) EVT_BUTTON(self, docform.DOC_DELLINK_BUTTON, self.OnUnlinkDocument) - + EVT_BUTTON(self, partslistform.ID_BUTTON_PARTS_CLOSE, self.OnClose) EVT_BUTTON(self, partslistform.ID_BUTTON_NEW_PARTSLIST, self.OnNewPartsList) EVT_BUTTON(self, partslistform.ID_BUTTON_SAVE_PARTSLIST, self.OnSaveObject) @@ -192,15 +191,13 @@ self.setDisplayWgt(displaywgts) self.skip_activate_event = False - + self.vsplitter.SetMinimumPaneSize(20) self.vsplitter.SplitVertically(self.vsplitter, self.editnb, 175) self.setCurrentObject(rootobj, nodedata) self.editnb.SetSelection(self.currentpage) self.setupPane(rootobj, nodedata) - - self.SecureMode() self.setMode(mode) @@ -210,11 +207,11 @@ if not rootobj: #print " whoopsie" return - + classname = rootobj.__class__.__name__ if not classname in ["Part", "Model", "Document", "PartsList"]: return - + self.currentobj = self.dm.newObject(classname) self.tempobj = self.dm.newObject(classname) self.currentobj.__dict__.update(rootobj.__dict__) @@ -235,7 +232,7 @@ self.rootobjs[self.PartsListPage] = rootobj.of_part self.rootobjs[self.PartDataPage] = rootobj.of_part self.currentpage = self.ModelPage - + elif classname == "PartsList": self.rootobjs[self.PartsListPage] = rootobj self.currentpage = self.PartsListPage @@ -251,7 +248,7 @@ classname = rootobj.__class__.__name__ currentform = None - + if classname == "Part": currentform = self.partform elif classname == "Model": @@ -288,7 +285,7 @@ self.propertiesform.propertiesgrid.ClearGrid() self.documentform.ClearForm() - + def SetName(self, name): if name == None: name = "New" @@ -297,25 +294,25 @@ def setDisplayWgt(self, display_wgts): self.DisplayWgts = display_wgts - + def UnsavedDataPageChanging(self, dialog_msg, creating_flag, currentpage, allow_tabbing = True): """ Does the actual grunt work of the checking when a tab changes In the next incarnation, will put message in the statusbar instead - + @type msg: string @param msg: The message that is to show in the dialog box - + @type creating_flag: boolean @param creating_flag: The flag that is used to determin if we are in a creating or editing mode - + @rtype boolean @return returns True if they want to remain in creating mode, False otherwise """ - + if creating_flag: dlg = wxMessageDialog(self, dialog_msg, "Unsaved Data", @@ -329,7 +326,7 @@ event.Veto() dlg.Destroy() return True - + def PageChanging(self, event): """ @@ -344,7 +341,7 @@ "Discard unsaved Part changes?", self.dm.creatingPart, self.currentpage) - + elif self.currentpage == self.ModelPage: self.dm.creatingModel = self.UnsavedDataPageChanging( "Discard unsaved Model changes?", @@ -366,7 +363,7 @@ def PageChanged(self, event=None): #print "itemeditframe.pagechanged" self.currentpage = self.editnb.GetSelection() - + if self.dm.creatingPart or \ self.dm.creatingModel or \ self.dm.creatingPartsList or \ @@ -375,7 +372,7 @@ if self.editingtab == self.currentpage: self.EditingMode(self.currentpage) self.sb.ClearMsg() - + else: self.sb.SetMsg( 'Currently editing on %s tab' % self.tabnames[ @@ -397,7 +394,7 @@ self.modelform.BrowseMode(gotroot) self.partslistform.BrowseMode(gotroot) self.documentform.BrowseMode(gotroot) - + def EditingMode(self, whichpane): #print 'itemeditframe.editmode', whichpane self.editingtab = self.currentpage @@ -441,12 +438,12 @@ self.dm.creatingPartsList = False self.dm.creatingPart = False self.dm.creatingModel = False - + def CreatingMode(self, whichpane): """Handles the setting of the correct mode based upon which pane of the notebook is being shown. - + @type whichpane: integer @param whichpane: the integer that corresponds with which tab we are dealing with. The ids start @@ -492,16 +489,8 @@ self.dm.creatingModel = False self.dm.creatingPartsList = False self.dm.creatingDocument = True - - def SecureMode(self): - actions = self.Parent.WatchDog.GetActions( - state['currentprojectname']) - self.partform.SetAllowed(actions) - self.modelform.SetAllowed(actions) - self.partslistform.SetAllowed(actions) - self.documentform.SetAllowed(actions) - + def OnResetDoc(self, event): #print "reset doc" self.dm.creatingDocument = False @@ -563,7 +552,7 @@ else: self.documentform.BrowseMode(False) - + def LinkDocument(self): #print "linkdoc" link = self.dm.newObject("DocPtRel") @@ -574,7 +563,7 @@ self.dm.add([link]) self.dm.addProjectObjects(state['currentprojectname'], [link]) - + rootdata = self.tree.GetPyData(self.tree.GetRootItem()) parent = self.dm.getLookupObject(rootdata[1]) if parent: @@ -587,7 +576,7 @@ return link - + def OnUnlinkDocument(self, event): # print "unlink doc" node = self.doctree.GetSelection() @@ -602,7 +591,7 @@ self.doctree.SetItemHasChildren(parent, False) self.doctree.SelectItem(self.doctree.GetRootItem()) - + def UnlinkDocument(self, pdrid): pdrobj = self.dm.getLookupObject(pdrid) if pdrobj.state: @@ -614,11 +603,11 @@ pdrobj.state = objectstatus.DELETE else: pdrobj.state = objectstatus.DELETE - + self.dm.RemovePDR(pdrid) self.dm.add([pdrobj]) return True - + def OnResetPart(self, event): #print "itemeditframe.onresetpart" self.EditItem = False @@ -627,7 +616,7 @@ if node.IsOk(): if node == self.tree.GetRootItem(): self.BrowseMode(True) - + obj = self.tree.GetPyData(node) if obj[0] == 'New': self.tree.DeleteAllItems() @@ -636,7 +625,7 @@ self.partform.revertNextId() self.dm.creatingPart = False return - + temp_obj = self.dm.getLookupObject(obj[1]) classname = temp_obj.__class__.__name__ if classname == "Part": @@ -680,7 +669,7 @@ if node.IsOk(): if node == self.modeltree.GetRootItem(): self.BrowseMode(True) - + obj = self.modeltree.GetPyData(node) if obj[0] == 'New': self.modeltree.DeleteAllItems() @@ -689,7 +678,7 @@ self.modelform.revertNextId() self.dm.creatingModel = False return - + temp_obj = self.dm.getLookupObject(obj[1]) classname = temp_obj.__class__.__name__ if classname == "Model": @@ -723,8 +712,8 @@ if self.dm.creatingModel: self.dm.creatingModel = False self.editingtab = None - - + + def OnEditPart(self, event): #print "itemeditframe.oneditpart", self.currentpage self.editingtab = self.currentpage @@ -752,14 +741,14 @@ self.editingtab = self.currentpage self.partslistform.CreatingMode() - + def OnEditPartsList(self, event): self.dm.creatingPartsList = True self.editingtab = self.currentpage self.EditPL = True self.partslistform.EditingMode() - + def OnLinkPartsList(self, event = None): # print "onlinkpl" link = pdr() @@ -801,19 +790,19 @@ parent.state = objectstatus.MODIFY self.dm.add([parent]) - + def OnPartsListView(self, event): #print "itemedit.onpartslistview" self.editnb.SetSelection(self.PartDataPage) self.partslistview.GetData(state['workingdir'], self.currentobj, self.dm.user, self.dm.serverHost, self.dm.serverPort) - + def OnNewPart(self, event): """ Handle the setting of the correct flags and modes for creating a product. - + @type event: wxEvent @param event: wxEvent Object passed by event loop """ @@ -823,12 +812,12 @@ self.dm.creatingModel = False self.partform.CreatingMode() - + def OnNewModel(self, event): """ Handle the setting of the correct flags and modes for creating a product. - + @type event: wxEvent @param event: wxEvent Object passed by event loop """ @@ -837,10 +826,10 @@ self.dm.creatingModel = True self.dm.creatingPart = False self.modelform.CreatingMode() - + def OnDeleteNauo(self, event): #print "itemeditframe.deletenauo" - + node = self.tree.GetSelection() if node.IsOk(): treetuple = self.tree.GetPyData(node) @@ -859,10 +848,10 @@ nauoobj.state = objectstatus.DELETE else: nauoobj.state = objectstatus.DELETE - + if self.tree.GetChildrenCount(parent) == 0: self.tree.SetItemHasChildren(parent, False) - + self.dm.add([nauoobj]) self.tree.SelectItem(self.tree.GetRootItem()) else: @@ -906,7 +895,7 @@ if not self.PLMtool.onSelectSource(): self.OnCloseImportPartsListFrame() - + except: print "plmrun.Running Linux!" @@ -927,7 +916,7 @@ self.currentobj._upload_file_name = PLM.GetPartsListFilename() self.PLM_Converted = self.PLMtool.Converted self.PLMtool.CloseDown() - + if self.ImportPartsListFrame: self.ImportPartsListFrame.Show(False) self.PLMtool = None @@ -962,10 +951,10 @@ self.partslistform.NextDocId) - 1) #print "end resetpartslist" - + def OnClose(self, event = None): #print "itemeditframe.onclose" - + if self.dm.uncommittedData(): self.dm.refresh = True @@ -977,7 +966,7 @@ if dlg.ShowModal() == wxID_YES: # retval = self.SaveChanges() retval = self.saveObjectChanges() - + if not retval: # problem occurred while saving changes... dlg.Destroy() @@ -1076,7 +1065,7 @@ self.tempobj.__dict__.update(plobj.__dict__) self.partslistform.fillForm(self.currentobj) self.partslistform.BrowseMode(False) - + elif self.currentpage == self.PartPage: if self.skip_activate_event: self.skip_activate_event = False @@ -1120,7 +1109,7 @@ self.currentobj.__dict__.update(partobj.__dict__) self.tempobj.__dict__.update(partobj.__dict__) self.partform.fillForm(self.currentobj) - + elif self.currentpage == self.ModelPage: if self.skip_activate_event: self.skip_activate_event = False @@ -1164,7 +1153,7 @@ self.currentobj.__dict__.update(modelobj.__dict__) self.tempobj.__dict__.update(modelobj.__dict__) self.modelform.fillForm(self.currentobj) - + elif self.currentpage == self.DocPage: if self.skip_activate_event: self.skip_activate_event = False @@ -1206,7 +1195,7 @@ self.tempobj.__dict__.update(docobj.__dict__) self.documentform.fillForm(self.currentobj) self.documentform.BrowseMode(False) - + def ChangesMade(self): @@ -1242,7 +1231,7 @@ "what is supposed to be going on here?"]) else: retval = True - + if self.dm.creatingDocument: # tmp = Document(id = 'tempid__12') tmp = self.dm.newObject("Document") @@ -1253,7 +1242,7 @@ "what is supposed to be going on here?"]) else: retval = True - + else: if self.dm.creatingPart or \ self.dm.creatingModel or \ @@ -1268,7 +1257,7 @@ self.documentform.ClearForm() return retval - + def DiscardChanges(self): if self.dm.creatingPartsList: plid = prefs.get('nextplid', 1) @@ -1278,7 +1267,7 @@ self.partslistform.NextDocId = str( int( self.partslistform.NextDocId) - 1) - + if self.dm.creatingDocument: docid = prefs.get('nextdocid', 1) docid = int(docid) - 1 @@ -1371,7 +1360,7 @@ self.Parent.GetPSMTool().UpdateWgts(save_object) return True - + def SetPartsListInfo(self, partslist): # print "setpartslistinfo" @@ -1417,17 +1406,17 @@ self.currentform.BrowseMode(True) self.currentform.GetNewWgt().SetFocus() - + self.dm.refresh = True # self.Parent.GetPSMTool().rebuildMainTree() self.editingtab = None - + def SaveObject(self, itemid): """ Save a new object (or changes to an existing object) into an object in the local database. - + @type itemid: string @param itemid: The oid of the object being edited. @return save_object: new/updated object @@ -1449,7 +1438,7 @@ save_object = self.dm.newObject("PartsList") elif self.dm.creatingDocument: save_object = self.dm.newObject("Document") - + self.currentform.Save(save_object) try: Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.14 PanGalactic/pangalactic/client/modules/psm/partform.py:1.15 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.14 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Fri Aug 20 02:11:25 2004 @@ -2,15 +2,13 @@ #import pangalactic.enterprise.part as part -from pangalactic.utils.mixin_security import Security_Mixin -from pangalactic.utils.securitymanager import actions from pangalactic.utils.preferences import prefs, writePrefs from pangalactic.utils.pgefstate import state from pangalactic.client.modules.psm.partform_wdr import * -class PartForm(wxPanel, Security_Mixin): +class PartForm(wxPanel): def __init__(self, parent, id, pos=wxPyDefaultPosition, size=wxPyDefaultSize, @@ -95,31 +93,18 @@ self.GetSaveWgt().Enable(False) self.GetDeleteWgt().Enable(False) self.GetResetWgt().Enable(False) - - if self.Allowed(actions.ADDITEM): - self.GetNewWgt().Enable(True) - else: - self.GetNewWgt().Enable(False) - - if self.Allowed(actions.MODIFYITEM): - self.GetEditWgt().Enable(True) - else: - self.GetEditWgt().Enable(False) + self.GetNewWgt().Enable(True) + self.GetEditWgt().Enable(True) def NodeMode(self): #print 'node mode' - self.GetCloseWgt().Enable(True) self.GetSaveWgt().Enable(False) self.GetNewWgt().Enable(False) self.GetEditWgt().Enable(False) self.GetResetWgt().Enable(False) - - if self.Allowed(actions.DELETEITEM): - self.GetDeleteWgt().Enable(True) - else: - self.GetDeleteWgt().Enable(False) + self.GetDeleteWgt().Enable(True) def HighlightFirstWgt(self): Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.68 PanGalactic/pangalactic/enterprise/pgefobject.py:1.69 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.68 Wed Aug 18 11:52:48 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Fri Aug 20 02:11:25 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.68 2004/08/18 15:52:48 waterbug Exp $ +# $Id: pgefobject.py,v 1.69 2004/08/20 06:11:25 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.68 $ +@version: $Revision: 1.69 $ """ -__version__ = "$Revision: 1.68 $"[11:-2] +__version__ = "$Revision: 1.69 $"[11:-2] import types import string @@ -610,7 +610,7 @@ lambda x: bool(getattr(x, 'min_cardinality', 0)), self._schema.properties)] for a in required: - val = getattr(self, a, None) + value = getattr(self, a, None) if value == None: msg = ''.join(["Missing data in ", self._schema.id, ".", a]) Index: PanGalactic/pangalactic/utils/__init__.py diff -u PanGalactic/pangalactic/utils/__init__.py:1.11 PanGalactic/pangalactic/utils/__init__.py:1.12 --- PanGalactic/pangalactic/utils/__init__.py:1.11 Fri Aug 20 01:31:12 2004 +++ PanGalactic/pangalactic/utils/__init__.py Fri Aug 20 02:11:26 2004 @@ -42,5 +42,9 @@ "toolframe", "ToolkitImages", "toolstate", +"usersearchgui", +"usersearchframe", +"usersearch_wdr", "utils", -"xmlrpcinterface"] +"xmlrpcinterface", +"xmltreewidget"] Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.39 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.40 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.39 Wed Aug 18 11:52:48 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Fri Aug 20 02:11:25 2004 @@ -1,17 +1,15 @@ -# $Id: partslistform.py,v 1.39 2004/08/18 15:52:48 waterbug Exp $ +# $Id: partslistform.py,v 1.40 2004/08/20 06:11:25 waterbug Exp $ -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] from wxPython.wx import wxPanel, wxTAB_TRAVERSAL, wxPyTypeCast, wxPyDefaultPosition, wxPyDefaultSize from wxPython.wx import wxFileDialog from partslistform_wdr import * from pangalactic.utils.pgefstate import state from pangalactic.utils.preferences import prefs, writePrefs -from pangalactic.utils.mixin_security import Security_Mixin -from pangalactic.utils.securitymanager import actions -class PartsListForm(wxPanel, Security_Mixin): +class PartsListForm(wxPanel): """ Dialog created with wxDesigner that is the display form for the parts list info. The actual wxDesigner code resides in partslistform_wdr.py @@ -129,16 +127,6 @@ button = self.GetNewWgt() button.Enable(True) - if not self.Allowed(actions.DELETEPARTSLIST): - pass #cannot delete the root node - if not self.Allowed(actions.ADDPARTSLIST): - button = self.GetNewWgt() - button.Enable(False) - if not self.Allowed(actions.MODIFYPARTSLIST): - button = self.GetEditWgt() - button.Enable(False) - #print "end rootmode" - def NodeMode(self): #print "partslistform.nodemode" @@ -153,16 +141,7 @@ button = self.GetNewWgt() button.Enable(False) - if not self.Allowed(actions.DELETEPARTSLIST): - pass - if not self.Allowed(actions.ADDPARTSLIST): - pass - if not self.Allowed(actions.MODIFYPARTSLIST): - button = self.GetEditWgt() - button.Enable(False) - #print "end nodemode" - - + def CreatingMode(self): self.ClearForm() self.Enable(True) @@ -222,18 +201,7 @@ button = self.GetNewWgt() button.Enable(False) - if self.Allowed(actions.DELETEPARTSLIST): - pass - if self.Allowed(actions.ADDPARTSLIST): - pass - if not self.Allowed(actions.MODIFYPARTSLIST): - button = self.GetImportPartsListButton() - button.Enable(False) - button = self.GetSaveWgt() - button.Enable(False) - button = self.GetResetWgt() - button.Enable(False) - + def LinkMode(self): self.Enable(True) ctrl = self.GetTextctrlPoc() From waterbug at ned.gsfc.nasa.gov Sat Aug 21 13:27:32 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sat Aug 21 13:27:35 2004 Subject: [Pangalactic-commits] Meta changes. Message-ID: <200408211727.i7LHRWgf025227@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/enterprise/pgefobject.py 1.69 1.70 PanGalactic/pangalactic/importers/owlreader.py 1.1 1.2 PanGalactic/pangalactic/meta/ontoclass.py 1.3 1.4 PanGalactic/pangalactic/meta/ontoproperty.py 1.2 1.3 PanGalactic/pangalactic/meta/registry.py 1.1 1.2 PanGalactic/pangalactic/test/IDTEST 1.52 1.53 Log message: Meta changes. Index: PanGalactic/pangalactic/meta/registry.py diff -u PanGalactic/pangalactic/meta/registry.py:1.1 PanGalactic/pangalactic/meta/registry.py:1.2 --- PanGalactic/pangalactic/meta/registry.py:1.1 Sun Aug 8 22:17:09 2004 +++ PanGalactic/pangalactic/meta/registry.py Sat Aug 21 13:27:30 2004 @@ -1,9 +1,9 @@ -# $Id: registry.py,v 1.1 2004/08/09 02:17:09 waterbug Exp $ +# $Id: registry.py,v 1.2 2004/08/21 17:27:30 waterbug Exp $ """ Pan Galactic Engineering Framework Registry -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ The PanGalacticRegistry maintains information about the pangalactic.enterprise classes and custom OntoClasses that is used by the @@ -16,7 +16,7 @@ lower-case. """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] import imp import re @@ -283,8 +283,8 @@ print ''.join([bbstr, '\n [properties defined or redefined locally]\n']) break - if oc.properties: - for p in oc.properties: + if oc.localproperties: + for p in oc.localproperties: print ' *', p.id print p.description else: Index: PanGalactic/pangalactic/meta/ontoproperty.py diff -u PanGalactic/pangalactic/meta/ontoproperty.py:1.2 PanGalactic/pangalactic/meta/ontoproperty.py:1.3 --- PanGalactic/pangalactic/meta/ontoproperty.py:1.2 Tue Aug 10 12:13:40 2004 +++ PanGalactic/pangalactic/meta/ontoproperty.py Sat Aug 21 13:27:30 2004 @@ -1,4 +1,4 @@ -# $Id: ontoproperty.py,v 1.2 2004/08/10 16:13:40 waterbug Exp $ +# $Id: ontoproperty.py,v 1.3 2004/08/21 17:27:30 waterbug Exp $ """ An OntoProperty corresponds to the concept of Property in the world of @@ -16,7 +16,11 @@ using OntoClass and Ontology), and in the future, views of schema instances (TODO: PGEF OntoView), and maps between schema instances (TODO: PGEF OntoMap). + +@version: $Revision: 1.3 $ """ +__version__ = "$Revision: 1.3 $"[11:-2] + from pangalactic.utils import utils @@ -125,8 +129,8 @@ 'description' :""" [rdf:ID] Identifier of the OntoProperty within some context or namespace (for PgefObject and its subclasses, the context of their - OntoProperty (_schema) id is the PanGalactic ontology's namespace). - (In RDF parlance, this is a "fragment identifier".) + OntoProperty id's is the PanGalactic ontology's namespace). (In + RDF parlance, this is a "fragment identifier".) """}, 'id_context' : {'pgef_datatype':'str', @@ -265,12 +269,22 @@ """} } + def __init__(self, **kw): """ Initialize an OntoProperty instance. """ for a in self._schema: setattr(self, a, kw.get(a, utils.getDefault(self._schema[a]))) + + + ###################################################################### + # Property: default + # + # 'default' is really the 'default value' for an attribute of the + # OntoProperty, but this naming can be thought of as similar to the + # SQL 'DEFAULT' keyword, which has the same semantic. + ###################################################################### def getDefault(self): return utils.getDefault(self) Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.69 PanGalactic/pangalactic/enterprise/pgefobject.py:1.70 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.69 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Sat Aug 21 13:27:29 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.69 2004/08/20 06:11:25 waterbug Exp $ +# $Id: pgefobject.py,v 1.70 2004/08/21 17:27:29 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.69 $ +@version: $Revision: 1.70 $ """ -__version__ = "$Revision: 1.69 $"[11:-2] +__version__ = "$Revision: 1.70 $"[11:-2] import types import string @@ -16,16 +16,23 @@ from mx import DateTime from pangalactic.meta.ontoclass import OntoClass from pangalactic.meta.ontoproperty import OntoProperty +from pangalactic.utils.displaymappable import DisplayMappable from pangalactic.utils import oid from pangalactic.utils import datetimes from pangalactic.utils import pgefexceptions from pangalactic.utils import utils -class PgefObject(object): +class PgefObject(object, DisplayMappable): """ - PgefObject is the base class for all of the PanGalactic - Enterprise classes (generic domain objects). + PgefObject is the base class for all of the PanGalactic Enterprise + classes (generic domain objects). + + PgefObject inherits the DisplayMappable + mix-in, giving it the functions getDisplayMap, getDisplayNames, + getDisplayOrder, addDisplayAttr, removeDisplayAttr, and + resetDefaultDisplay, which enable it to manage how the [Onto]Properties + in its _schema are displayed in user interfaces. @type _default_display_order: list @cvar _default_display_order: the names of all "public" @@ -375,70 +382,9 @@ pass # some properties might be read-only - def getDisplayMap(self, dorder=None, dnames=None, dtypes=None): - """ - Generate a grid map from the combination of a - display_order list, a display_names mapping, and a - display_types mapping. - """ - #print "pgefobject.getdisplaymap" - attr_names = [p.id for p in self._schema.properties] - labels = [(attr_name, attr_name.replace("_", " ").title().strip()) - for attr_name in attr_names] - if not self._schema._default_display_names: - self._schema._default_display_names = dict(labels) - - if not self._schema._default_display_order: - labels.sort(utils.compareSequence1) - self._schema._default_display_order = [label[0] for label in labels] - - if not self._schema._default_display_types: - attr_types = [(attr_name, "string") for attr_name in attr_names] - self._schema._default_display_types = dict(attr_types) - for attr_name, attr_type in attr_types: - obj = self.__dict__[attr_name] - if isinstance(obj, PgefObject): - self._schema._default_display_types[attr_name] = obj.name - - if not dnames: - dnames = self._schema._default_display_names - if not dorder: - dorder = self._schema._default_display_order - if not dtypes: - dtypes = self._schema._default_display_types - - self._display_order = copy.copy(self._schema._default_display_order) - self._display_names = self._schema._default_display_names.copy() - self._display_types = self._schema._default_display_types.copy() - - return [[x, dnames.get(x, x), dtypes.get(x, "string")] for x in dorder] - - def getDisplayNames(self): - if not self._display_names: - foo = self.getDisplayMap() - return self._display_names - - def getDisplayOrder(self): - if not self._display_order: - foo = self.getDisplayMap() - return self._display_order - - def addDisplayAttr(self, attrname, attrlabel, pos): - if attrname in self._display_order: - return - self._display_order.insert(pos, attrname) - self._display_names[attrname] = attrlabel - - def removeDisplayAttr(self, attrname): - if not attrname in self._display_order: - return - self._display_order.remove(attrname) - del self._display_names[attrname] - - def resetDefaultDisplay(self): - self._display_order = copy.copy(self._schema._default_display_order) - self._display_names = self._schema._default_display_names.copy() - self._display_types = self._schema._default_display_types.copy() + ######################### + # Property: create_date + ######################### def set_string_date(self, value): raise TypeError, 'Attribute cannot be set' @@ -456,6 +402,10 @@ set_string_date, delete_date, 'create_date') + + ###################### + # Property: mod_date + ###################### def get_mod_date(self): if self.mod_datetime: Index: PanGalactic/pangalactic/importers/owlreader.py diff -u PanGalactic/pangalactic/importers/owlreader.py:1.1 PanGalactic/pangalactic/importers/owlreader.py:1.2 --- PanGalactic/pangalactic/importers/owlreader.py:1.1 Sun Aug 8 22:38:49 2004 +++ PanGalactic/pangalactic/importers/owlreader.py Sat Aug 21 13:27:30 2004 @@ -1,12 +1,12 @@ -# $Id: owlreader.py,v 1.1 2004/08/09 02:38:49 waterbug Exp $ +# $Id: owlreader.py,v 1.2 2004/08/21 17:27:30 waterbug Exp $ """ Reader for OWL (Web Ontology Language) -@version: $Revision: 1.1 $ +@version: $Revision: 1.2 $ """ -__version__ = "$Revision: 1.1 $"[11:-2] +__version__ = "$Revision: 1.2 $"[11:-2] # PanGalactic imports from pangalactic.meta.ontology import Ontology @@ -23,10 +23,10 @@ def __init__(self): self._parser = RDF.Parser() - def import(self, f): + def import(self, path): """ Import a set of OntoClasses and OntoProperties from an OWL - file. (For now, just do + file. For now, just do * rdf:Property * rdfs:Class @@ -35,4 +35,4 @@ * owl:ObjectProperty """ m = RDF.Model() - self._parser.parse_into_model(m, f) + # self._parser.parse_into_model(m, f) Index: PanGalactic/pangalactic/meta/ontoclass.py diff -u PanGalactic/pangalactic/meta/ontoclass.py:1.3 PanGalactic/pangalactic/meta/ontoclass.py:1.4 --- PanGalactic/pangalactic/meta/ontoclass.py:1.3 Wed Aug 11 02:21:10 2004 +++ PanGalactic/pangalactic/meta/ontoclass.py Sat Aug 21 13:27:30 2004 @@ -1,18 +1,21 @@ -# $Id: ontoclass.py,v 1.3 2004/08/11 06:21:10 waterbug Exp $ +# $Id: ontoclass.py,v 1.4 2004/08/21 17:27:30 waterbug Exp $ """ An OntoClass specifies the persistable attribute information structure of a 'domain object' (an object that is part of the end-user's or domain -expert's view). Domain objects in the world of ontologies are defined as -being members of a ontological Class -- hence the PGEF name 'OntoClass'. -The attributes of an ontological Class are specified by 'Properties', which -in RDF and RDF-derived representations are defined to be binary -relationships between the Class and either RDF literals and XML Schema -datatypes (in which case they are 'datatype properties') or instances of -Classes (in which case they are 'object properties'). -""" +expert's view). + +Domain objects in the world of ontologies are defined as being members of a +ontological Class -- hence the PGEF name 'OntoClass'. The attributes of an +ontological Class are specified by 'Properties', which in RDF and +RDF-derived representations are defined to be binary relationships between +the Class and either RDF literals and XML Schema datatypes (in which case +they are 'datatype properties') or instances of Classes (in which case they +are 'object properties'). -__version__ = "$Revision: 1.3 $"[11:-2] +@version: $Revision: 1.4 $ +""" +__version__ = "$Revision: 1.4 $"[11:-2] from pangalactic.utils import utils @@ -20,13 +23,15 @@ """ An OntoClass specifies the persistable attribute information structure of a 'domain object' (an object that is part of the end-user's or - domain expert's view). Domain objects in the world of ontologies are - defined as being members of a ontological Class -- hence the PGEF name - 'OntoClass'. The attributes of an ontological Class are specified by - 'Properties', which in RDF and RDF-derived representations are defined - to be binary relationships between the Class and either RDF literals - and XML Schema datatypes (in which case they are 'datatype properties') - or instances of Classes (in which case they are 'object properties'). + domain expert's view). + + Domain objects in the world of ontologies are defined as being members + of a ontological Class -- hence the PGEF name 'OntoClass'. The + attributes of an ontological Class are specified by 'Properties', which + in RDF and RDF-derived representations are defined to be binary + relationships between the Class and either RDF literals and XML Schema + datatypes (in which case they are 'datatype properties') or instances + of Classes (in which case they are 'object properties'). @param id: [rdfs:ID] identifier of the OntoClass. @type id: str @@ -79,7 +84,8 @@ [rdf:ID] Identifier of the OntoClass within some context or namespace (for PgefObject and its subclasses, the context of their OntoClass (_schema) id is the PanGalactic ontology's namespace). - (In RDF parlance, this is a "fragment identifier".) + (In RDF parlance, this usage of id is called a "fragment + identifier".) """}, 'id_context' : {'pgef_datatype':'str', @@ -142,7 +148,7 @@ 'max_cardinality':0, 'description' :""" [rdf:Property] A set of Properties, selected from among all the - Properties of which this OntoClass is the domain, as being the + Properties for which this OntoClass is the domain, as being the important Properties to be managed, reasoned with, and persisted with this OntoClass in the context of the Ontology within which it is defined. @@ -174,6 +180,7 @@ [p.id for p in self.properties]) self.properties = [self[pid] for pid in basepropertyids + localpropertyids] + self.localproperties = [self[pid] for pid in localpropertyids] def getDefaultDisplayOrder(self): Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.52 PanGalactic/pangalactic/test/IDTEST:1.53 --- PanGalactic/pangalactic/test/IDTEST:1.52 Wed Aug 18 01:41:48 2004 +++ PanGalactic/pangalactic/test/IDTEST Sat Aug 21 13:27:30 2004 @@ -1 +1 @@ -846 \ No newline at end of file +856 \ No newline at end of file From waterbug at ned.gsfc.nasa.gov Sat Aug 21 13:28:45 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sat Aug 21 13:28:47 2004 Subject: [Pangalactic-commits] Add DisplayMappable mix-in. Message-ID: <200408211728.i7LHSjDK025266@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/displaymappable.py None 1.1 Log message: Add DisplayMappable mix-in. From waterbug at ned.gsfc.nasa.gov Tue Aug 24 00:19:37 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 24 00:19:39 2004 Subject: [Pangalactic-commits] mx is required by client too. Message-ID: <200408240419.i7O4JbMB025956@ned.gsfc.nasa.gov> Modified files: PanGalactic/INSTALL 1.13 1.14 Log message: mx is required by client too. Index: PanGalactic/INSTALL diff -u PanGalactic/INSTALL:1.13 PanGalactic/INSTALL:1.14 --- PanGalactic/INSTALL:1.13 Thu Aug 19 17:49:13 2004 +++ PanGalactic/INSTALL Tue Aug 24 00:19:35 2004 @@ -54,6 +54,9 @@ http://www.openssl.org Configuration: see that site for installation procedures. + - mxDateTime (latest released version) + http://www.egenix.com/files/python/eGenix-mx-Extensions.html#Download-mxBASE + (2) Required for the PGEF Client: @@ -94,9 +97,6 @@ - pyPgSQL (version 2.4 is recommended; 2.3 or better is required) http://pypgsql.sourceforge.net - - mxDateTime (latest released version) - http://www.egenix.com/files/python/eGenix-mx-Extensions.html#Download-mxBASE - - Redland RDF Application Framework http://www.redland.opensource.ac.uk @@ -230,4 +230,4 @@ twistd -f pger.tap ----------------------------------------------------------------- -$Id: INSTALL,v 1.13 2004/08/19 21:49:13 waterbug Exp $ +$Id: INSTALL,v 1.14 2004/08/24 04:19:35 waterbug Exp $ From waterbug at ned.gsfc.nasa.gov Wed Aug 25 01:25:45 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 25 01:25:48 2004 Subject: [Pangalactic-commits] Put ... getDisplayMap ... BACK! :) Message-ID: <200408250525.i7P5Pjjd010959@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/enterprise/pgefobject.py 1.70 1.71 PanGalactic/pangalactic/utils/displaymappable.py 1.1 None Log message: Put ... getDisplayMap ... BACK! :) Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.70 PanGalactic/pangalactic/enterprise/pgefobject.py:1.71 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.70 Sat Aug 21 13:27:29 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Wed Aug 25 01:25:43 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.70 2004/08/21 17:27:29 waterbug Exp $ +# $Id: pgefobject.py,v 1.71 2004/08/25 05:25:43 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.70 $ +@version: $Revision: 1.71 $ """ -__version__ = "$Revision: 1.70 $"[11:-2] +__version__ = "$Revision: 1.71 $"[11:-2] import types import string @@ -16,24 +16,17 @@ from mx import DateTime from pangalactic.meta.ontoclass import OntoClass from pangalactic.meta.ontoproperty import OntoProperty -from pangalactic.utils.displaymappable import DisplayMappable from pangalactic.utils import oid from pangalactic.utils import datetimes from pangalactic.utils import pgefexceptions from pangalactic.utils import utils -class PgefObject(object, DisplayMappable): +class PgefObject(object): """ PgefObject is the base class for all of the PanGalactic Enterprise classes (generic domain objects). - PgefObject inherits the DisplayMappable - mix-in, giving it the functions getDisplayMap, getDisplayNames, - getDisplayOrder, addDisplayAttr, removeDisplayAttr, and - resetDefaultDisplay, which enable it to manage how the [Onto]Properties - in its _schema are displayed in user interfaces. - @type _default_display_order: list @cvar _default_display_order: the names of all "public" attributes in the order in which they are to be displayed @@ -380,6 +373,76 @@ setattr(self, a, kw[a]) except: pass # some properties might be read-only + + + def getDisplayMap(self, dorder=None, dnames=None, dtypes=None): + """ + Generate a grid map from the combination of a display_order list, a + display_names mapping, and a display_types mapping. + """ + #print "pgefobject.getdisplaymap" + attr_names = [p.id for p in self._schema.properties] + labels = [(attr_name, attr_name.replace("_", " ").title().strip()) + for attr_name in attr_names] + if not getattr(self._schema, '_default_display_names', None): + self._schema._default_display_names = dict(labels) + + if not getattr(self._schema, '_default_display_order', None): + labels.sort(utils.compareSequence1) + self._schema._default_display_order = [label[0] for label in labels] + + if not getattr(self._schema, '_default_display_types', None): + attr_types = [(attr_name, "string") for attr_name in attr_names] + self._schema._default_display_types = dict(attr_types) + for attr_name, attr_type in attr_types: + obj = self.__dict__[attr_name] + if isinstance(obj, PgefObject): + self._schema._default_display_types[attr_name] = obj.name + + if not dnames: + dnames = self._schema._default_display_names + if not dorder: + dorder = self._schema._default_display_order + if not dtypes: + dtypes = self._schema._default_display_types + + self._display_order = copy.copy(self._schema._default_display_order) + self._display_names = self._schema._default_display_names.copy() + self._display_types = self._schema._default_display_types.copy() + + return [[x, dnames.get(x, x), dtypes.get(x, "string")] for x in dorder] + + def getDisplayNames(self): + """ + Generate a grid map from the combination of a display_order list, a + display_names mapping, and a display_types mapping. + """ + if not self._display_names: + foo = self.getDisplayMap() + return self._display_names + + def getDisplayOrder(self): + if not self._display_order: + foo = self.getDisplayMap() + return self._display_order + + + def addDisplayAttr(self, attrname, attrlabel, pos): + if attrname in self._display_order: + return + self._display_order.insert(pos, attrname) + self._display_names[attrname] = attrlabel + + + def removeDisplayAttr(self, attrname): + self._display_order.remove(attrname) + del self._display_names[attrname] + + + def resetDefaultDisplay(self): + self._display_order = copy.copy(self._schema._default_display_order) + self._display_names = self._schema._default_display_names.copy() + self._display_types = self._schema._default_display_types.copy() ######################### From waterbug at ned.gsfc.nasa.gov Wed Aug 25 03:35:08 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 25 03:35:10 2004 Subject: [Pangalactic-commits] Cruft removal. Message-ID: <200408250735.i7P7Z81G011573@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py 1.40 1.41 Log message: Cruft removal. Index: PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py diff -u PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.40 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.40 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py Wed Aug 25 03:35:07 2004 @@ -1,17 +1,17 @@ -# $Source: /repo/step_testbed/PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py,v $ +# $Id: itemdroptarget.py,v 1.41 2004/08/25 07:35:07 waterbug Exp $ import cPickle -import pangalactic.enterprise.model as model -import pangalactic.enterprise.acu as acu -import pangalactic.utils.objectstatus as objectstatus - +from pangalactic.enterprise.model import Model +from pangalactic.enterprise.acu import Acu +from pangalactic.utils import objectstatus +from pangalactic.utils.pgefstate import state from pangalactic.utils import pgefevents from wxPython.wx import wxCustomDataObject, wxCustomDataFormat, wxPyDropTarget from wxPython.wx import wxPoint, wxTreeItemIcon_Selected -__version__ = "$Revision: 1.40 $"[11:-2] +__version__ = "$Revision: 1.41 $"[11:-2] #constants @@ -134,7 +134,7 @@ if self.tree.GetPyData(targetnode)[1] == dropitem.pgef_oid: return d targetitem = self.dm.getLookupObject(targetdata[1]) - targetnauo = self.dm.getAcuByComponent(targetitem) #localDB.GetNauoByComponentID(targetitem) + targetnauo = self.dm.getAcuByComponent(targetitem) #print 'targetnauo is ', targetnauo if targetnauo == None: targetnauo = "TOPLEVEL" @@ -142,9 +142,10 @@ elif DragFromGrid: #print "drag from grid" targetitem = self.dm.getLookupObject(targetdata[1]) - #print 'project is: ', self.dm.CurrentProject + #print 'project is: ', state['currentproject'] - targetnauo = self.dm.getAcuByComponent(targetitem, self.dm.CurrentProject.id) + targetnauo = self.dm.getAcuByComponent(targetitem, + state['currentproject']) #print '******** targetitem is', targetitem.id #print '******** targetnauo is', targetnauo @@ -171,16 +172,14 @@ # create new nauo #print "create new nauo" - newnauo = acu.Acu(subtype = 'nauo') + newnauo = Acu(subtype = 'nauo') newnauo.component = dropitem newnauo.state = objectstatus.ADD - newnauo.initObject(self.dm.CurrentProject, self.dm.user.id) + newnauo.initObject(state['currentproject'], self.dm.user.id) if haverootnode: #print "haverootnode; assembly is TOPLEVEL" - #tlobj = pmv.ProductModelVersion(id_context = self.dm.CurrentProject) - tlobj = pmv.ProductModelVersion(_project = self.dm.CurrentProject) - tlobj = model.Model(_project = self.dm.CurrentProject) + tlobj = Model(project = state['currentproject']) #tlobj.pgef_oid = "TOPLEVEL" ## wtf???? vwk newnauo.assembly = tlobj else: @@ -191,12 +190,12 @@ # add new nauo to localdb self.dm.addAcu(newnauo, targetnauo) try: - if isinstance(targetitem, model.Model):#pmv.ProductModelVersion): + if isinstance(targetitem, Model): targetitem.has_parts_flag = 1 targetitem.state = objectstatus.MODIFY self.dm.add([targetitem]) except: - print "Warning! Warning! Danger, Will Robinson! error saving item with new children" + print "Danger, Will Robinson! error saving item with new children" if haverootnode: #print "itemdroptarget: 2a: expand" From waterbug at ned.gsfc.nasa.gov Wed Aug 25 03:37:48 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 25 03:37:50 2004 Subject: [Pangalactic-commits] Be more careful. Message-ID: <200408250737.i7P7bmZo011616@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/enterprise/pgefobject.py 1.71 1.72 PanGalactic/pangalactic/test/IDTEST 1.53 1.54 Log message: Be more careful. Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.71 PanGalactic/pangalactic/enterprise/pgefobject.py:1.72 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.71 Wed Aug 25 01:25:43 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Wed Aug 25 03:37:45 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.71 2004/08/25 05:25:43 waterbug Exp $ +# $Id: pgefobject.py,v 1.72 2004/08/25 07:37:45 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.71 $ +@version: $Revision: 1.72 $ """ -__version__ = "$Revision: 1.71 $"[11:-2] +__version__ = "$Revision: 1.72 $"[11:-2] import types import string @@ -528,7 +528,8 @@ Populate certain attributes of a PgefObject that should be populated at creation time. """ - self.project = currentproject + if hasattr(self, 'project'): + self.project = currentproject # project should be pushed down into specific # subtypes; doesn't make sense for all objects self.owner = userid Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.53 PanGalactic/pangalactic/test/IDTEST:1.54 --- PanGalactic/pangalactic/test/IDTEST:1.53 Sat Aug 21 13:27:30 2004 +++ PanGalactic/pangalactic/test/IDTEST Wed Aug 25 03:37:46 2004 @@ -1 +1 @@ -856 \ No newline at end of file +876 \ No newline at end of file From waterbug at ned.gsfc.nasa.gov Wed Aug 25 03:57:04 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 25 03:57:05 2004 Subject: [Pangalactic-commits] currentprojectname -> currentproject Message-ID: <200408250757.i7P7v4xm011690@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.6 1.7 PanGalactic/pangalactic/client/modules/psm/docform.py 1.10 1.11 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.40 1.41 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.154 1.155 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.29 1.30 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.40 1.41 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.40 1.41 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.183 1.184 PanGalactic/pangalactic/utils/datamanager.py 1.149 1.150 Log message: currentprojectname -> currentproject Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.6 PanGalactic/pangalactic/client/pangalaxian.py:1.7 --- PanGalactic/pangalactic/client/pangalaxian.py:1.6 Wed Aug 18 02:44:18 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Wed Aug 25 03:57:01 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.6 2004/08/18 06:44:18 waterbug Exp $ +# $Id: pangalaxian.py,v 1.7 2004/08/25 07:57:01 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.6 $ +@version: $Revision: 1.7 $ """ -__version__ = "$Revision: 1.6 $"[11:-2] +__version__ = "$Revision: 1.7 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -314,15 +314,15 @@ print 'PanGalaxian: userid =', self.user.id state['currentuserid'] = self.user.id oid.setOidBase(useroid) - state['currentprojectname'] = state.get('lastproject', + state['currentproject'] = state.get('lastproject', None) or prefs.get( 'defaultproject', 'NoProject') writeState() - print 'PanGalaxian: current project =', state['currentprojectname'] + print 'PanGalaxian: current project =', state['currentproject'] self.WatchDog = SecurityManager(self.user) self.dm = DataManager(self.WatchDog, - projectid=state['currentprojectname']) + projectid=state['currentproject']) self.ActivateTool() self.onModeChange() show_tooltips = prefs.get("ShowToolTips", False) Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.40 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.40 Wed Aug 18 11:52:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Wed Aug 25 03:57:02 2004 @@ -8,16 +8,14 @@ from pangalactic.client.modules.psm import docform from pangalactic.client.modules.psm import pgefdoctree from pangalactic.client.modules.psm import doctreeframe - from pangalactic.enterprise.document import Document -#from pangalactic.enterprise.pgeffile import PgefFile - from pangalactic.utils.securitymanager import actions as security_actions from pangalactic.utils.pgefexceptions import RequiredDataError +from pangalactic.utils.pgefstate import state from pangalactic.utils import objectstatus from pangalactic.utils.preferences import prefs, writePrefs -__version__ = "$Revision: 1.40 $"[11:-2] +__version__ = "$Revision: 1.41 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -105,7 +103,7 @@ dfile.state = objectstatus.ADD self.dm.save([newdoc, dfile]) - self.dm.addProjectObjects(self.State.currentprojectname, + self.dm.addProjectObjects(state['currentproject'], [newdoc, dfile]) if self.EditMode: self.EditMode = False Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.10 PanGalactic/pangalactic/client/modules/psm/docform.py:1.11 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.10 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Wed Aug 25 03:57:02 2004 @@ -174,10 +174,10 @@ wgt = self.GetIdentifierWgt() self.NextDocId = str(int(self.NextDocId) + 1) - if not state['currentprojectname']: + if not state['currentproject']: wgt.SetValue("DOC-" + self.NextDocId) else: - wgt.SetValue(''.join([state['currentprojectname'], + wgt.SetValue(''.join([state['currentproject'], "-DOC-", self.NextDocId])) prefs["nextdocid"] = self.NextDocId Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.40 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.40 Wed Aug 18 11:52:48 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Wed Aug 25 03:57:02 2004 @@ -22,7 +22,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.40 $"[11:-2] +__version__ = "$Revision: 1.41 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -120,17 +120,7 @@ self.dm.add([partslist]) - self.dm.addProjectObjects(self.State.currentprojectname, [partslist]) -# replace all this with the above line --vwk -# allprojlist = self.dm.localDB.GetProjectObjects() -# if allprojlist.has_key(self.State.currentprojectname): -# projlist = self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] -# if len(projlist) == 0: -# projlist = {} -# else: -# projlist = {} -# projlist[partslist.pgef_oid] = partslist.__class__.__name__ -# self.dm.localDB.GetProjectObjects()[self.State.currentprojectname] = projlist + self.dm.addProjectObjects(state['currentproject'], [partslist]) if self.EditMode: # print "editpl" @@ -145,7 +135,7 @@ self.dm.refresh = True self.buildTree() else: - partslist.initObject(self.State.currentprojectname, self.dm.user.id) + partslist.initObject(state['currentproject'], self.dm.user.id) self.currentdocument(**partslist.__dict__) # foobar - SOAP can't handle compound subobjects - pull 'em out and put 'em elsewhere Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.40 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.40 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Wed Aug 25 03:57:02 2004 @@ -1,6 +1,6 @@ -# $Id: partslistform.py,v 1.40 2004/08/20 06:11:25 waterbug Exp $ +# $Id: partslistform.py,v 1.41 2004/08/25 07:57:02 waterbug Exp $ -__version__ = "$Revision: 1.40 $"[11:-2] +__version__ = "$Revision: 1.41 $"[11:-2] from wxPython.wx import wxPanel, wxTAB_TRAVERSAL, wxPyTypeCast, wxPyDefaultPosition, wxPyDefaultSize from wxPython.wx import wxFileDialog @@ -155,10 +155,10 @@ wgt = self.GetTextctrlPartslistid() #bryan self.NextDocId = str(int(self.NextDocId) + 1) - if state['currentprojectname'] == None: + if not state['currentproject']: wgt.SetValue("PL-" + self.NextDocId) else: - wgt.SetValue(state['currentprojectname'] + "-PL-" + self.NextDocId) + wgt.SetValue(state['currentproject'] + "-PL-" + self.NextDocId) wgt.SetFocus() prefs['nextplid'] = self.NextDocId writePrefs() Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.154 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.155 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.154 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Wed Aug 25 03:57:02 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.154 2004/08/20 06:11:25 waterbug Exp $ +# $Id: itemeditframe.py,v 1.155 2004/08/25 07:57:02 waterbug Exp $ -__version__ = "$Revision: 1.154 $"[11:-2] +__version__ = "$Revision: 1.155 $"[11:-2] import copy import types @@ -562,7 +562,7 @@ link.state = objectstatus.ADD self.dm.add([link]) - self.dm.addProjectObjects(state['currentprojectname'], [link]) + self.dm.addProjectObjects(state['currentproject'], [link]) rootdata = self.tree.GetPyData(self.tree.GetRootItem()) parent = self.dm.getLookupObject(rootdata[1]) @@ -756,10 +756,10 @@ link.product = "ROOT" #self.rootitemid link.document = self.currentobj.pgef_oid link.state = objectstatus.ADD - link.initObject(state['currentprojectname'], self.dm.user.id) + link.initObject(state['currentproject'], self.dm.user.id) self.dm.add([link]) - self.dm.addProjectObjects(state['currentprojectname'], [link]) + self.dm.addProjectObjects(state['currentproject'], [link]) node = self.partslisttree.GetSelection() rootnode = self.partslisttree.GetRootItem() @@ -1355,7 +1355,7 @@ self.dm.creatingDocument = False self.dm.add([save_object]) - self.dm.addProjectObjects(state['currentprojectname'], + self.dm.addProjectObjects(state['currentproject'], [save_object]) self.Parent.GetPSMTool().UpdateWgts(save_object) return True @@ -1516,7 +1516,7 @@ self.currentobj.__dict__.update(save_object.__dict__) self.tempobj.__dict__.update(save_object.__dict__) - self.dm.addProjectObjects(state['currentprojectname'], + self.dm.addProjectObjects(state['currentproject'], [save_object]) return save_object Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.29 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.30 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.29 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Wed Aug 25 03:57:02 2004 @@ -7,12 +7,11 @@ #import pangalactic.enterprise.document as document class OtherDocForm(wxPanel): - def __init__(self, parent, id, state, delmode = True, debu = 0, + def __init__(self, parent, id, delmode = True, debu = 0, pos = wxPyDefaultPosition, size = wxPyDefaultSize, style = wxTAB_TRAVERSAL): wxPanel.__init__(self, parent, id, pos, size, style) self.parent = parent - self.State = state self.NextDocId = prefs.get("nextdocid", 0) prefs["nextdocid"] = self.NextDocId @@ -176,10 +175,12 @@ wgt = self.GetIdentifierWgt() self.NextDocId = str(int(self.NextDocId) + 1) - if self.State.currentprojectname == None: + if not state['currentproject']: wgt.SetValue("DOC-" + self.NextDocId) else: - wgt.SetValue(self.State.currentprojectname + "-DOC-" + self.NextDocId) + wgt.SetValue(''.join([state['currentproject'], + "-DOC-", + self.NextDocId])) prefs["nextdocid"] = self.NextDocId writePrefs() Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.149 PanGalactic/pangalactic/utils/datamanager.py:1.150 --- PanGalactic/pangalactic/utils/datamanager.py:1.149 Wed Aug 18 11:52:49 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Wed Aug 25 03:57:02 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.149 2004/08/18 15:52:49 waterbug Exp $ +# $Id: datamanager.py,v 1.150 2004/08/25 07:57:02 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.149 $ +@version: $Revision: 1.150 $ """ -__version__ = "$Revision: 1.149 $"[11:-2] +__version__ = "$Revision: 1.150 $"[11:-2] import time import mx.DateTime @@ -220,7 +220,7 @@ klass = self._registry.pgef_classes[classname] obj = klass(id="NEW", id_context=self.CurrentProject.id_context, - project=state['currentprojectname']) + project=state['currentproject']) obj.initObject(self.CurrentProject.id, self.user.id) return obj Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.183 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.184 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.183 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Wed Aug 25 03:57:02 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.183 2004/08/20 06:11:25 waterbug Exp $ +# $Id: psmtool.py,v 1.184 2004/08/25 07:57:02 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.183 $"[11:-2] +__version__ = "$Revision: 1.184 $"[11:-2] import os @@ -403,7 +403,7 @@ grid=currentgrid, skipcols=None, filename=None, - defaultfname = state['currentprojectname'] + '_parts') + defaultfname = state['currentproject'] + '_parts') if temp.exportpath: fullpath = temp.exportpath temp.Destroy() @@ -411,7 +411,7 @@ temp.Destroy() return fdlg = wxFileDialog(self, "Choose a file", fullpath, - ''.join([state['currentprojectname'], + ''.join([state['currentproject'], '_properties', '.xls']), '*.xls', wxSAVE) @@ -507,7 +507,7 @@ self.showItem(itemobj) def OnShowProjectFrame(self, event): - self.ShowProjectFrame(state['currentprojectname']) + self.ShowProjectFrame(state['currentproject']) def ShowProjectFrame(self, project): if self.projectframe: @@ -569,7 +569,7 @@ def OnNewPartsList(self): print "PSMTool.OnNewPartsList" - print "currentproject", state['currentprojectname'] + print "currentproject", state['currentproject'] foo = PartsListTreeFrame(self.Parent, self.dm) foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -577,7 +577,7 @@ def OnNewDoc(self): - print "PSMTool.OnNewDoc", state['currentprojectname'] + print "PSMTool.OnNewDoc", state['currentproject'] foo = DocumentTreeFrame(self.Parent, self.dm) foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -671,7 +671,7 @@ objlist = objectlist if len(objlist) > 0: - self.dm.setCurrentProject(state['currentprojectname']) + self.dm.setCurrentProject(state['currentproject']) retval = self.dm.commit(objlist) # change the grid background colour to the default colour @@ -721,7 +721,7 @@ else: print "looking for children" - # self.dm.setCurrentProject(state['currentprojectname']) + # self.dm.setCurrentProject(state['currentproject']) treetuple = self.tree.GetPyData(node) obj = self.dm.getLookupObject(treetuple[1]) if state['loggedin']: @@ -892,9 +892,9 @@ selection = wgt.GetStringSelection() ndx = wgt.GetSelection() # if selection == 'Select a Project': - # if state.get('currentprojectname', 'None'): - # project = state['currentprojectname'] - # print 'currentprojectname = ', project + # if state.get('currentproject', 'None'): + # project = state['currentproject'] + # print 'currentproject = ', project # wgt.SetSelection(wgt.FindString(project)) # self.dm.setCurrentProject(project) # ndx = wgt.GetSelection() @@ -905,7 +905,7 @@ def changeProject(self, projectname): print "PSMTool.changeProject" print "project", projectname - state['currentprojectname'] = projectname + state['currentproject'] = projectname self.dm.setCurrentProject(projectname) wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) @@ -949,7 +949,7 @@ def UpdateWindows(self): if self.projectframe: - self.projectframe.Setup(state['currentprojectname']) + self.projectframe.Setup(state['currentproject']) if self.itemeditform: self.itemeditform.OnClose() if self.SearchFrame: @@ -1058,11 +1058,11 @@ for pkey, proj in projects.items(): wgt.Append(proj.id) wgt.Enable(True) - if state['currentprojectname']: - ndx = wgt.FindString(state['currentprojectname']) + if state['currentproject']: + ndx = wgt.FindString(state['currentproject']) if ndx <> wxNOT_FOUND: - wgt.SetSelection(wgt.FindString(state['currentprojectname'])) - wgt.SetStringSelection(state['currentprojectname']) + wgt.SetSelection(wgt.FindString(state['currentproject'])) + wgt.SetStringSelection(state['currentproject']) else: wgt.SetSelection(0) From waterbug at ned.gsfc.nasa.gov Wed Aug 25 04:02:45 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Wed Aug 25 04:02:48 2004 Subject: [Pangalactic-commits] missed one Message-ID: <200408250802.i7P82jvK012148@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/localdb.py 1.107 1.108 Log message: missed one Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.107 PanGalactic/pangalactic/utils/localdb.py:1.108 --- PanGalactic/pangalactic/utils/localdb.py:1.107 Mon Aug 16 06:14:19 2004 +++ PanGalactic/pangalactic/utils/localdb.py Wed Aug 25 04:02:43 2004 @@ -309,7 +309,7 @@ def GetLocalAcus(self, currentproject = None): - #print "getlocalacus", currentproject.id + #print "getlocalacus", currentproject acu_dict = self.GetACUDict() uncommitted_dict = self.GetUncommittedDict() @@ -319,7 +319,7 @@ pass else: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject.id: + if currentproject and childobj.project == currentproject: # add project_context = "DEMO" or something similar to the above line - TBD objdict[nid] = nobj @@ -328,7 +328,7 @@ if objdict.has_key(nid): if nobj.state <> objectstatus.DELETE: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject.id: + if currentproject and childobj.project == currentproject: objdict[nid] = nobj else: objdict[nid] = nobj @@ -337,7 +337,7 @@ else: if nobj.state <> objectstatus.DELETE: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject.id: + if currentproject and childobj.project == currentproject: objdict[nid] = nobj else: objdict[nid] = nobj From waterbug at ned.gsfc.nasa.gov Thu Aug 26 18:38:33 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Thu Aug 26 18:38:35 2004 Subject: [Pangalactic-commits] localdb api is now private to dm (except for dbbrowser). Message-ID: <200408262238.i7QMcXnJ010235@ned.gsfc.nasa.gov> Modified files: PanGalactic/NEWTASKS 1.1 1.2 PanGalactic/TODO 1.12 1.13 PanGalactic/pangalactic/client/pangalaxian.py 1.7 1.8 PanGalactic/pangalactic/client/modules/psm/doctreeframe.py 1.27 1.28 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py 1.41 1.42 PanGalactic/pangalactic/client/modules/psm/pgeftree.py 1.41 1.42 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.184 1.185 PanGalactic/pangalactic/client/modules/psm/searchframe.py 1.40 1.41 PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py 1.22 1.23 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py 1.39 1.40 PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py 1.25 1.26 PanGalactic/pangalactic/test/IDTEST 1.54 1.55 PanGalactic/pangalactic/utils/basegrid.py 1.36 1.37 PanGalactic/pangalactic/utils/cagesearchframe.py 1.4 1.5 PanGalactic/pangalactic/utils/configuregrid.py 1.8 1.9 PanGalactic/pangalactic/utils/datamanager.py 1.150 1.151 PanGalactic/pangalactic/utils/dbbrowser.py 1.29 1.30 PanGalactic/pangalactic/utils/localdb.py 1.108 1.109 PanGalactic/pangalactic/utils/objectreport.py 1.14 1.15 PanGalactic/pangalactic/utils/orggrid.py 1.3 1.4 PanGalactic/pangalactic/utils/pdfoptions.py 1.5 1.6 PanGalactic/pangalactic/utils/usergrid.py 1.4 1.5 PanGalactic/pangalactic/utils/usersearchframe.py 1.7 1.8 Log message: localdb api is now private to dm (except for dbbrowser). Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.7 PanGalactic/pangalactic/client/pangalaxian.py:1.8 --- PanGalactic/pangalactic/client/pangalaxian.py:1.7 Wed Aug 25 03:57:01 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Thu Aug 26 18:38:28 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.7 2004/08/25 07:57:01 waterbug Exp $ +# $Id: pangalaxian.py,v 1.8 2004/08/26 22:38:28 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.7 $ +@version: $Revision: 1.8 $ """ -__version__ = "$Revision: 1.7 $"[11:-2] +__version__ = "$Revision: 1.8 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -894,8 +894,7 @@ dbb_frame.menuBar.SetLabel(toolframe.ID_FILE_EXIT, '&Close') dbb_frame.menuBar.SetHelpString(toolframe.ID_FILE_EXIT, "Close this window") - dbb_frame.mainpanel = dbbrowser.zodbbrowser(dbb_frame, -1, - localdb=self.dm.localDB) + dbb_frame.mainpanel = dbbrowser.zodbbrowser(dbb_frame, -1, self.dm) config_access = self.dm.getConfigAccess() dbb_frame.mainpanel.FillChoice(config_access) dbb_frame.CentreOnParent() Index: PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py diff -u PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py:1.22 PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py:1.23 --- PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py:1.22 Wed Jun 30 16:47:15 2004 +++ PanGalactic/pangalactic/enterprise/workflow/wfinstanceoverview.py Thu Aug 26 18:38:30 2004 @@ -103,11 +103,9 @@ # print d.wfdata.id # print "\tc", d.create_datetime, "\tu", d.last_status_update, "\tu-s", d._last_status_update_str self.gridtable = wfdatatable.WfDataTable() - self.grid = WorkflowGrid(self, -1, - classname = classname, - localdb = self.dm.localDB, - intable = self.gridtable, - colourlist = workflow_wizard.colourlist) + self.grid = WorkflowGrid(self, -1, classname=classname, + dm=self.dm, intable=self.gridtable, + colourlist=workflow_wizard.colourlist) self.grid.SetSize(self.parent.GetClientSize()) if len(datalist) > 0: Index: PanGalactic/pangalactic/client/modules/psm/pgeftree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.41 PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.42 --- PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.41 Wed Aug 18 01:41:47 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgeftree.py Thu Aug 26 18:38:29 2004 @@ -1,10 +1,10 @@ -# $Id: pgeftree.py,v 1.41 2004/08/18 05:41:47 waterbug Exp $ +# $Id: pgeftree.py,v 1.42 2004/08/26 22:38:29 waterbug Exp $ """ Base class for PanGalaxian's trees -@version: $Revision: 1.41 $ +@version: $Revision: 1.42 $ """ -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] import cPickle, types @@ -21,7 +21,7 @@ from pangalactic.client.modules.psm import itemdroptarget from pangalactic.client.io import treereport -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] class PgefTree(wxTreeCtrl): @@ -152,7 +152,7 @@ print " - getting more acus from server ..." dm.getNAUOByAssemblyID([rootobj.pgef_oid]) - localacus = dm.getLocalAcus(dm.CurrentProject) + localacus = dm.getLocalAcus(state['currentproject']) for acuid, acuobj in localacus.items(): if acuobj.assembly == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: AcuIds.append(acuid) Index: PanGalactic/pangalactic/client/modules/psm/searchframe.py diff -u PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.40 PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.41 --- PanGalactic/pangalactic/client/modules/psm/searchframe.py:1.40 Sun Aug 8 22:53:45 2004 +++ PanGalactic/pangalactic/client/modules/psm/searchframe.py Thu Aug 26 18:38:29 2004 @@ -56,7 +56,7 @@ self.partgrid = basegrid.BaseGrid(self.searchnb, self.PART_SEARCH_GRID, classname = "Part", - localdb = self.dm.localDB) + dm = self.dm) self.partgrid.SetRowLabelSize(0) self.partgrid.EnableEditing(False) grid_tooltip = "A table of Parts found." @@ -67,7 +67,7 @@ self.modelgrid = basegrid.BaseGrid(self.searchnb, self.MODEL_SEARCH_GRID, classname = "Model", - localdb = self.dm.localDB) + dm = self.dm) self.modelgrid.SetRowLabelSize(0) self.modelgrid.EnableEditing(False) grid_tooltip = "A table of Models found." @@ -78,7 +78,7 @@ self.plgrid = basegrid.BaseGrid(self.searchnb, self.PL_SEARCH_GRID, classname = "PartsList", - localdb = self.dm.localDB) + dm = self.dm) self.plgrid.SetRowLabelSize(0) self.plgrid.EnableEditing(False) grid_tooltip = "A table of Parts Lists found." @@ -89,7 +89,7 @@ self.docgrid = basegrid.BaseGrid(self.searchnb, self.DOC_SEARCH_GRID, classname = "Document", - localdb = self.dm.localDB) + dm = self.dm) self.docgrid.EnableEditing(False) grid_tooltip = "A table of Documents found." self.docgrid.GetGridWindow().SetToolTip(wxToolTip(grid_tooltip)) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.184 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.185 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.184 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Thu Aug 26 18:38:29 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.184 2004/08/25 07:57:02 waterbug Exp $ +# $Id: psmtool.py,v 1.185 2004/08/26 22:38:29 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.184 $"[11:-2] +__version__ = "$Revision: 1.185 $"[11:-2] import os @@ -32,14 +32,13 @@ from pangalactic.enterprise.pgefobject import PgefObject from pangalactic.utils import datamanager -#from pangalactic.utils import dbbrowser from pangalactic.utils import objectstatus from pangalactic.utils import toolframe -from pangalactic.utils.preferences import prefs -from pangalactic.utils.pgefstate import state from pangalactic.utils import pgdialogs from pangalactic.utils import ToolkitImages from pangalactic.utils import basegrid +from pangalactic.utils.preferences import prefs +from pangalactic.utils.pgefstate import state from pangalactic.client.support import httpdownload from pangalactic.client.modules.psm import toolbarpanel @@ -49,8 +48,6 @@ from pangalactic.client.modules.psm import mystuffoptions from pangalactic.client.modules.psm import projectframe from pangalactic.client.modules.psm import itemeditframe -#from pangalactic.client.modules.psm import pgefgrid -from pangalactic.utils import basegrid from pangalactic.client.modules.psm import doctreeframe from pangalactic.client.modules.psm.documenttreeframe import DocumentTreeFrame from pangalactic.client.modules.psm.partslisttreeframe import PartsListTreeFrame @@ -116,13 +113,10 @@ -1, wxDefaultPosition, wxSize(200, 200)) - #Create grid to hold Models -# self.modelgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, -# classname = "Model", -# localdb = self.dm.localDB) + # Create grid to hold Models self.modelgrid = basegrid.BaseGrid(self.grid_notebook, -1, - classname = "Model", - localdb = self.dm.localDB) + classname="Model", + dm=self.dm) grid_tooltip = """A tabular display of the data in the models of the currently selected project. Doubleclick on a part to display the Model Editor. @@ -136,12 +130,9 @@ # initially has a scrollbar self.modelgrid.Fit() # Create Grid to hold Parts -# self.itemgrid = pgefgrid.PgefGrid(self.grid_notebook, -1, -# classname = "Part", -# localdb = self.dm.localDB) self.itemgrid = basegrid.BaseGrid(self.grid_notebook, -1, - classname = "Part", - localdb = self.dm.localDB) + classname="Part", + dm=self.dm) grid_tooltip = """A tabular display of the data in the parts of the currently selected project. Doubleclick on a part to display the Part Editor. Index: PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py diff -u PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.39 PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.40 --- PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py:1.39 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/enterprise/workflow/wfprocessoverview.py Thu Aug 26 18:38:30 2004 @@ -104,10 +104,8 @@ def setupGrid(self, datalist, classname): #print "wfpo.setupgrid", classname self.gridtable = wfdatatable.WfDataTable() - self.grid = WorkflowGrid(self, -1, - classname = classname, - localdb = self.dm.localDB, - intable = self.gridtable) + self.grid = WorkflowGrid(self, -1, classname=classname, + dm=self.dm, intable=self.gridtable) self.grid.SetSelectionMode(1) self.grid.SetSize(self.parent.GetClientSize()) self.FillGrid(datalist) Index: PanGalactic/TODO diff -u PanGalactic/TODO:1.12 PanGalactic/TODO:1.13 --- PanGalactic/TODO:1.12 Fri Mar 5 20:28:48 2004 +++ PanGalactic/TODO Thu Aug 26 18:38:28 2004 @@ -4,17 +4,15 @@ [*] in progress [+] done -* [-] set up Roundup bug/issue tracker for Pan Galactic - * [-] interface to Express Engine (Expresso) [-] stdin/stdout communication [-] import/export Express Engine OSEB [-] PB interface for EE * [*] import/export functions + [-] RDF/RDFS/OWL [*] pgx (ASCII "extract" format) [*] XML (only Alerts so far) - [-] RDF/RDFS/OWL [-] OSEB (old Part 28) [-] Part 21 @@ -27,8 +25,7 @@ [-] Express-X maps to/from AP209 * [-] DB modeling and mapping tool - [-] PanGalactification of System Modeling Workbench - http://www.abo.fi/~iporres/html/smw.html + [-] Ontology modeler * [*] installer script [+] sets up the PostgreSQL database and loads reference @@ -55,5 +52,5 @@ * [-] incorporate component architecture (adapters, etc.) ----------------------------------------------------------------- -$Id: TODO,v 1.12 2004/03/06 01:28:48 waterbug Exp $ +$Id: TODO,v 1.13 2004/08/26 22:38:28 waterbug Exp $ Index: PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py diff -u PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.41 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.42 --- PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.41 Wed Aug 25 03:35:07 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py Thu Aug 26 18:38:29 2004 @@ -1,4 +1,4 @@ -# $Id: itemdroptarget.py,v 1.41 2004/08/25 07:35:07 waterbug Exp $ +# $Id: itemdroptarget.py,v 1.42 2004/08/26 22:38:29 waterbug Exp $ import cPickle @@ -11,7 +11,7 @@ from wxPython.wx import wxPoint, wxTreeItemIcon_Selected -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] #constants @@ -187,7 +187,7 @@ newnauo.assembly = targetitem #print "newnauo", newnauo.id, newnauo.assembly.id, newnauo.component.id - # add new nauo to localdb + # add new acu self.dm.addAcu(newnauo, targetnauo) try: if isinstance(targetitem, Model): Index: PanGalactic/pangalactic/utils/objectreport.py diff -u PanGalactic/pangalactic/utils/objectreport.py:1.14 PanGalactic/pangalactic/utils/objectreport.py:1.15 --- PanGalactic/pangalactic/utils/objectreport.py:1.14 Sat Aug 14 19:54:45 2004 +++ PanGalactic/pangalactic/utils/objectreport.py Thu Aug 26 18:38:30 2004 @@ -1,11 +1,11 @@ -# $Id: objectreport.py,v 1.14 2004/08/14 23:54:45 waterbug Exp $ +# $Id: objectreport.py,v 1.15 2004/08/26 22:38:30 waterbug Exp $ """ Generator for tabular PDF reports from the grid. -@version: $Revision: 1.14 $ +@version: $Revision: 1.15 $ """ -__version__ = "$Revision: 1.14 $"[11:-2] +__version__ = "$Revision: 1.15 $"[11:-2] import types from reportlab.pdfgen.canvas import Canvas @@ -125,7 +125,7 @@ return temp - def getTable(self, total_cols = None): + def getTable(self, total_cols=None): t = Table(self.GetData(total_cols)) t.hAlign = "LEFT" t.setStyle(self.table_style) Index: PanGalactic/pangalactic/utils/cagesearchframe.py diff -u PanGalactic/pangalactic/utils/cagesearchframe.py:1.4 PanGalactic/pangalactic/utils/cagesearchframe.py:1.5 --- PanGalactic/pangalactic/utils/cagesearchframe.py:1.4 Wed Aug 18 12:07:20 2004 +++ PanGalactic/pangalactic/utils/cagesearchframe.py Thu Aug 26 18:38:30 2004 @@ -26,7 +26,7 @@ self.resultsgrid = orggrid.OrgGrid(self.searchnb, self.CAGE_RESULTS_GRID, classname="Organization", - localdb=self.dm.localDB) + dm=self.dm) self.resultsgrid.allow_config_flag = False # at least for now # self.resultsgrid.SetRowLabelSize(0) Index: PanGalactic/pangalactic/client/modules/psm/doctreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.27 PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.28 --- PanGalactic/pangalactic/client/modules/psm/doctreeframe.py:1.27 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/doctreeframe.py Thu Aug 26 18:38:29 2004 @@ -1,4 +1,4 @@ -# $Id: doctreeframe.py,v 1.27 2004/08/20 06:11:25 waterbug Exp $ +# $Id: doctreeframe.py,v 1.28 2004/08/26 22:38:29 waterbug Exp $ import types import copy @@ -14,7 +14,7 @@ from pangalactic.utils import basegrid from pangalactic.utils import ToolkitImages -__version__ = "$Revision: 1.27 $"[11:-2] +__version__ = "$Revision: 1.28 $"[11:-2] NEW_MODE = 1 @@ -45,7 +45,7 @@ self.grid = basegrid.BaseGrid(self.nb, -1, "Document", - localdb = self.dm.localDB) + dm=self.dm) self.grid.SetSelectionMode(wxGrid.wxGridSelectCells) grid_tooltip = "A tabular display of the meta data of " + \ "the locally available documents." Index: PanGalactic/pangalactic/test/IDTEST diff -u PanGalactic/pangalactic/test/IDTEST:1.54 PanGalactic/pangalactic/test/IDTEST:1.55 --- PanGalactic/pangalactic/test/IDTEST:1.54 Wed Aug 25 03:37:46 2004 +++ PanGalactic/pangalactic/test/IDTEST Thu Aug 26 18:38:30 2004 @@ -1 +1 @@ -876 \ No newline at end of file +886 \ No newline at end of file Index: PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py diff -u PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py:1.25 PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py:1.26 --- PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py:1.25 Mon Jul 19 16:07:49 2004 +++ PanGalactic/pangalactic/enterprise/workflow/workflowgrid.py Thu Aug 26 18:38:30 2004 @@ -52,7 +52,7 @@ ### BaseGrid has a different rightclick menu. An UpdateData() has been ### added. - def __init__(self, parent, id, classname, localdb, intable, colourlist = None): + def __init__(self, parent, id, classname, dm, intable, colourlist=None): """ @type parent: wxPanel (usually) @param parent: The parent widget for this grid. @@ -60,15 +60,15 @@ @type id: integer @param id: -1. ignored. - @type localdb: @see: L{LocalStorage } - @param localdb: A reference to the ubiquitous local cache. + @type dm: @see: L{} + @param dm: A reference to the ubiquitous DataManager. @type intable: wxGridTableBase @param intable: A reference to an existing tablebase class. If None, a PgefDataTable will be instantiated. """ - basegrid.BaseGrid.__init__(self, parent, id, classname, localdb, intable) + basegrid.BaseGrid.__init__(self, parent, id, classname, dm, intable) # self.SetSelectionMode(1) # 1 is wxGridSelectRow grid_tooltip = "A tabular display of the Workflows.\n" + \ Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.108 PanGalactic/pangalactic/utils/localdb.py:1.109 --- PanGalactic/pangalactic/utils/localdb.py:1.108 Wed Aug 25 04:02:43 2004 +++ PanGalactic/pangalactic/utils/localdb.py Thu Aug 26 18:38:30 2004 @@ -37,12 +37,9 @@ WF_CLASSES = ["WfActivity", "WfProcessInstance", "WfTransition", "WfEventAudit"] -EXCLUDE_CLASSES = ["ACUByAssembly", "DisplayConfig", "Passwd", - "UncommittedDocumentIDs", "OidLookup"] class LocalStorage: - ACUBYASSEMBLY = "ACUByAssembly" ACUDICT = "Acu" DCU = "Dcu" CATEGORY = "OntoClass" @@ -77,8 +74,7 @@ # second field - does this dict persist after clearing localdb? # third field - who sees the dict displayed in the dbbrowser? - dictlist = [(ACUBYASSEMBLY, 1, god), - (ACUDICT, 1, user), + dictlist = [(ACUDICT, 1, user), (CATEGORY, 0, user), (DISPLAY_CONFIG, 1, admin), (DCU, 1, admin), Index: PanGalactic/NEWTASKS diff -u PanGalactic/NEWTASKS:1.1 PanGalactic/NEWTASKS:1.2 --- PanGalactic/NEWTASKS:1.1 Mon Mar 8 16:05:42 2004 +++ PanGalactic/NEWTASKS Thu Aug 26 18:38:28 2004 @@ -2,246 +2,149 @@ [*] in progress [+] done -ID Description Status Version Date Name - 0.) Implement Unsaved Status Testing V1 - 1.) dclick on tree to bring up edit/view windows Done V0 - 2.) rclick on tree to popup menu to get details OBE TBD - 3.) components -> project components Done V0 - 4.) data tab disappears - no results tab Done V0 - 5.) search moves to menu and toolbar - popup windows Done V0 - 6.) keep tabs on top Done V0 - 7.) partslist tab moves to Deleted NA - 8.) replicate button bar on documents Done V0 - 9.) move partslist dataform to new itemdata window - tab Done V0 -10.) hide document tab Done V0 -11.) no DM visible - hide/grey button Done V0 -12.) ned -> pgpdm Done V0 -13.) attributes component Done V0 -14.) IDR Done V0 -15.) implement partslist Expanded V1 -16.) only edit root on small tree - grey edit button unless root selected Done V0 -17.) only delete/add from/to root node in small tree Done V0 -18.) need msg in caption box - below button on edit Done V0 -19.) msg dialog if dclick and edits made Done V0 -20.) set user status msg Done V0 -21.) only drag/drop in tree or from grid to tree Done V0 -22.) separate offline checkout and online ZODB InProgress V1 bmuir -23.) add read-only server-commit date to partslist OBE NA -24.) default POC to userid - readonly Done V0 -25.) change number to identifier Done V0 -26.) change ids to userid@nnn Done V0 -27.) server to misspiggy TBD TBD -28.) demo scenario OnGoing TBD waterbug/vkeech -29.) upload partslist and assoc with item Expanded V1 -30.) change ned to ip address Done V0 -31.) add userid to preferences Done V1 -32.) add pl to PLM OBE NA -33.) add nodetype to tree data TBD V1+ -34.) identifier is required - display in tree Done V0 -35.) need to make new demoscript DUP NA -36.) permanent demo site InProgress V1 waterbug -37.) need to set rootitem if we bring up editor without logging in Done V0 -38.) identifier to be projcode + doc-type + number Done V1 -39.) filename - interim - oid.tsv Done V1 vkeech/waterbug -40.) /usr/local/data/files/partslist - server location Done V0 -41.) authentication in every server call Done V1 4jan02 vkeech/waterbug -42.) create cfg file if file is corrupt Done V0 -43.) need db refresh Done V1 12feb02 vkeech -44.) weird icon image Done V0 -45.) need to fill in new partslist form after creation Deleted NA -46.) tree drag/drop move/copy -> move Done V1 bmuir -47.) epims <-> pgpdm column cross reference in PLM Done V1 21mar02 vkeech -48.) configure server to upload files Done V1 29jan02 waterbug -49.) edit partslist in grid in PLM InProgress V1 vkeech -50.) new pgpdm version notification - script TBD V1+ -51.) multiple pl creation bug Done V1 -52.) menu to flush/clean ZODB Done V1 -53.) menu option - method to retrieve items where POC is userid Done V1 21dec01 bmuir -54.) local db browser TBD V1+ -55.) "mark" add checkmark cell to mystuff grid (all items, pl's, docs) Done V1 -56.) combobox with local/servername Done V1 -57.) entire db copy script TBD TBD -58.) make drag/drop not use ctrl key Done V1 -59.) move this list to misspiggy Done V1 -60.) checkin changes to vendor code (log4p) Done V1 -61.) email (x500) as userid -> popup dialog to prompt Done V1 -62.) local = server local = project - userid is email Testing V1 bmuir -63.) add project as root node Done V1 -64.) set all menuids to wxnewid Done V0 -65.) make itemeditframe all the same - w/tree Done V1 -66.) make sure debug level is initially set Done V1 -67.) bug when editing non-root node after page swapping Done V1 -68.) merge plm/psm tool menuitems to file/tools Done V1 -69.) add search to tools menu Done V1 -70.) right button mouse menu on tree Done V1 -71.) need dialog to change server Testing V1 bmuir -72.) Add "Done" button to editframe + add to grid Done V1 -73.) move ZODB to data directory, add temp dir Done V1 -74.) grid tablebase TBD V1+ -75.) add working cursor when popping up editframe Done V1 -76.) soap via cgi TBD V1+ waterbug/ssingh -77.) getidrbyitemid.sh only sends idrs, not docs OBE V1 -78.) gui problem with getmystuff Done V1 19dec01 vkeech -79.) need to clear out tree on getmystuff Done V1 21dec01 bmuir -80.) dclick on grid pops up the item editor Done V1 20dec01 vkeech -81.) add Edit Component option to rclick menu on tree Done V1 20dec01 vkeech -82.) getmystuff only gets waterbug stuff Done V1 20dec01 bmuir -83.) need to check for "ROOT" item when trying to popup editor OBE V1 20dec01 vkeech -84.) create new toplevel node by allowing drop onto project Done V1 21dec01 vkeech -85.) need to clean up empty rows after getmystuff then toplevel Done V1 bmuir -86.) add View to main menu bar TBD V1+ - View->Component Tree - ->Parts List Tree - ->Document Tree -87.) need different icon for project (use psm icon) Done V1 24jan02 bmuir/vkeech -88.) need to build a tree with document children OBE NA -89.) left click pops up window with document metadata (check about mouseover) TBD V1+ -90.) rclick menu has option to retrieve and view parts list/document TBD V1+ -91.) query for uncommitted data on logout Done V1 15jan02 vkeech -92.) change checkedout from string to class with server/dts/offline flag Done V1 bmuir -93.) Add parts tab and partslist view button to itemeditframe Done V1 15jan02 vkeech -94.) Need to fix nedbroker.py to remove explicit os.chdir() TBD TBD -95.) Upload partslist part data file to server Done V1 29jan02 waterbug/vkeech -96.) Export partslist part data from grid to Excel file Done V1 vkeech -97.) Retrieve partslist part data from server Done V1 29jan02 vkeech/waterbug -98.) Display partslist part data in grid Done V1 vkeech -99.) Change "Attributes" to "Component" on itemeditframe Done V1 16jan02 vkeech -100.) Do for "other documents" what we've done for partslists InProgress V1+ vkeech -101.) Remove module buttons from buttonbar Done V1 22jan02 vkeech -102.) Add "Server" label to server combo Done V1 24jan02 bmuir -103.) Create column mapping database table TBD V1 waterbug -104.) Script to retrieve column mapping TBD V1 waterbug -105.) Script to add column mapping TBD V1 waterbug -106.) Fix mark column checkbox doubleclick Done V1 28jan02 bmuir -107.) Implement this list with a bug-tracking system TBD V1+ -108.) Sort item/doc version in tree - most recent first TBD V1+ -109.) Save creates a new object Done V1 vkeech -110.) Check scripts and rdb files for owner:group Done V1 waterbug/vkeech -111.) Click on partlist tree updates partslistview Done V1 vkeech -112.) Click on partlistview draws doctree Done V1 vkeech -113.) Only display parts list columns in server mapping OBE V1+ vkeech -114.) Commit of items created in Local mode Done V1 bmuir -115.) Help/About: display "PGPDM Client [version number] [build date]" Done V1 bmuir -116.) Main window: label tree as "Main Tree" TBD V1+ bmuir -117.) Component Tool: change File/Exit to File/Close Done V1 bmuir -118.) Parts List panel: Type not being filled in browse mode Done V1 vkeech -119.) Parts List Data grid: improve performance of rendering Done V1 vkeech -120.) On Main Tree: change right click menu to Done V1 bmuir - - Show Top Level Components - - View/Edit Component -121.) Component Tool: deactivate pull-downs for Type and Crit Code when Done V1 13feb02 vkeech - in read-only mode -122.) Main window: left-justify pull-downs and change order to: Done V1 bmuir - - - also, change tab to "Components Used on [project_name_code]" -123.) Commit: display "results" and keep client-side log of commits Done V1 bmuir - first phase - put up dialog when completed -124.) Save updates main tree and edit tree Testing V1 bmuir -125.) Add subcomponent to component X; all instances of X updated InProgress V1 bmuir -126.) Fix > 2000 rows in grid Done V1 12feb02 vkeech -127.) Script to get item count for item grid fill OBE V1 waterbug -128.) Script to get part count for part grid fill TBD V1+ waterbug -129.) Call count script prior to item retrieval for grid creation/fill OBE V1 -130.) Call count script prior to partslist retrieval for grid creation/fill TBD V1+ -131.) Refactor phase I : clientgui.py Done V1 bmuir/vkeech -132.) Refactor phase II : everything else (post funding) TBD TBD -133.) Double-clicking on root item shouldn't trigger busy cursor Done V1 12feb02 bmuir -134.) leave localmode and login, selected component shouldn't be in combo Done V1 12feb02 bmuir -135.) on login, grid is cleared of empty rows Done V1 12feb02 bmuir -136.) dclick on tree/grid item should pop up editor in browse mode Done V1 13feb02 vkeech -137.) remove filename from partslist metadata Done V1 vkeech -138.) move getmystuff results to search window Done V1 bmuir -139.) resize partslistgrid after loading data Done V1 16feb02 vkeech -140.) optimize partslist file load Done V1 21feb02 vkeech -141.) add gauge to status bar for data retrieval (added to main and toolframe) Done V1 19feb02 bmuir -142.) add properties tab to itemeditframe Done V1 vkeech -143.) need to create a REAL project TBD V1+ waterbug -144.) script to download properties OBE V1 -145.) base properties files for each item type (board, assembly, etc.) TBD V1+ waterbug -146.) use gauge to display progress whereever needed TBD V1+ -147.) add File->Export to export excel spreadsheet Done V1 bmuir - - sheet 1 is item grid - - successive sheets are properties, and are named by item code -148.) create properties files named .properties in files/properties Done V1? 28mar02 vkeech/waterbug -149.) use different directories on download of parts lists and properties Done V1+ 28mar02 vkeech/waterbug -150.) avoid the display of the grid cell editor Done V1 bmuir -151.) userid is not displayed on the local cache window; check all windows Done V1 22feb02 vkeech -152.) dragndrop doesn't work for toplevel items Done V1 01mar02 vkeech -153.) itemeditframe is not filled in with item data Done V1 vkeech -154.) dragndrop messed up from grid to tree Done V1 01mar02 vkeech -155.) put servername in place of userid - add green light Testing V1 bmuir -156.) add servername to login screen Testing V1 bmuir -157.) remove server combo - startup in local mode; logout to local mode Testing V1 bmuir -158.) doubleclick on root item in main tree pops up project edit window TBD V1+ -159.) component editor should not access server in local mode Done V1? 06mar02 vkeech -160.) put search button on left and clear button on right in search tool Done V1? bmuir -161.) new component/partslist should come up in creating mode Done V1? vkeech -162.) items dropped onto editframe should not have plusses Done V1? 05mar02 vkeech -163.) when Get Marked Items completes, open Cache Viewer to show result Done V1? 15Mar02 bmuir -164.) change wording on Component Tool panel Done V1? 11mar02 vkeech - from: "You can add or delete links to its subcomponents" - to: "You can add or delete its subcomponents" - (we know you add/del links, but end-user adds/dels subcomponents) -165.) fix Dr. Watson problem with Excel (!) Done? V1? 15mar02 vkeech -166.) disable the "synthetic properties generator" ... ;^) Done V1? 11mar02 vkeech -167.) in PLM, make Data Options guess data location based on Column Options Done V1? 12mar02 vkeech - (right now, Data Options guesses that data begins in row 2 regardless of - what Column Label Options is set to, e.g. even if headers span 4 cols) -168.) change name of Column Options tab to "Column Mapping" Done V1? 12mar02 vkeech -169.) fix Column Mapping to read labels from row(s) specified in C.L.O. Done V1? Before vkeech - (right now, it is reading column labels from row 1 only, regardless - of what Column Label Options is set to -- it needs to "unwrap" the - labels, if they span rows, and show each label as a single line in map) -170.) add a checkbox on "Login successful, Select a Project" message to Done V1? 15mar02 bmuir - *not* display it every time! (status bar shows success ...) -171.) when Parts List creation (New) is cancelled, reset last-used Testing V1+ bmuir - identifier (right now, it's incremented even if "new" is cancelled) -172.) move spreadsheet browse/convert subpanel from Parts List panel Done V1? 15mar02 bmuir - to its own panel on the Import a Parts List dialogue -- - give it a tab called "Spreadsheet Selection", and put a button on - the Parts List panel called "Import Parts List Data" -173.) change name of Import a Parts List to "Import Parts List Data" Done V1? 13mar02 vkeech -174.) each step in PL import needs a progress bar (with a big parts list TBD V1? - file, the data loading for each step can take several seconds) -175.) need better display for mapping -- maybe show it in a grid Done V1 26mar02 vkeech -176.) need progress meter for parts list file "get" TBD V1? -177.) make sure itemeditframe is updated from main window ops Done V1? 21mar02 vkeech -178.) export column mapping to local file (and check for one before import) Done V1+ 21mar02 vkeech -179.) remove output file fields from plm file window OBE V1+ -180.) in spreadsheet conversion, either dismiss window when done or Done V1? 28mar02 vkeech - pop up a window saying "Conversion completed." with an OK button, - which dismisses itself and the conversion window (for now, at least :^) -181.) gray-out all Repository menu choices when in Local mode Done V1? 14Mar02 bmuir -182.) on Import Parts List Data, eliminate Select Spreadsheet panel, Done V1+ 28mar02 vkeech - and instead bring up a file selection dialog when the Import Parts List - Data button is pushed. -183.) on Import Parts List Data / Data Options panel, select the row Done V1? 13mar02 vkeech - that has been guessed as the first data row (and update it to keep in - sync with the row number selected in the panel above it) -184.) for Get Marked Items, pop up a dialog for user to specify whether to Testing V1 bmuir - Include: [] Parts lists (later, [] Documents) -185.) multiple newpl or newitem (from menu) builds tree of new's Done V1+ 21mar02 vkeech -186.) only display mapped columns - not all of them Done V1+ 21mar02 vkeech -187.) remove status textfield from plm pages; use status bar Done V1+ 28mar02 vkeech -188.) enforce data types when importing, exporting, and/or TBD V1 - mapping parts list data from/to spreadsheets - (note: currently, all pl data columns except quantity are text) -189.) document.rdb? TBD V1+ -190.) modify getidr script(s) to differentiate between pls and docs TBD V1+ -191.) modify upload to differentiate between filetypes InProgress V1+ -192.) edit should put new object in hierarchy InProgress V1+ -193.) add pdf capability to grid Testing V1 bmuir -194.) make html frame for viewing html based docs TBD V1+ -195.) Add Admin tools TBD V1+ -196.) make version # visible in grid and forms Testing V1 -197.) Start adding unit testing TBD V1+ -198.) update doc strings TBD V1+ -199.) Add version, version number to rdb TBD V1 -200.) onProjectClick should make sure that cell (0,0) is visible TBD TBD +Stat Description Version Date Name +[+] dclick on tree to bring up edit/view windows +[+] rclick on tree to popup menu to get details OBE TBD +[+] components -> project components V0 +[+] data tab disappears - no results tab V0 +[+] search moves to menu and toolbar - popup windows V0 +[+] keep tabs on top V0 +[+] replicate button bar on documents V0 +[+] move partslist dataform to new itemdata window - tab V0 +[+] hide document tab V0 +[+] no DM visible - hide/grey button V0 +[+] ned -> pgpdm V0 +[+] attributes component V0 +[+] IDR V0 +[+] only edit root on small tree - grey edit button unless root selected V0 +[+] only delete/add from/to root node in small tree V0 +[+] need msg in caption box - below button on edit V0 +[+] msg dialog if dclick and edits made V0 +[+] set user status msg V0 +[+] only drag/drop in tree or from grid to tree V0 +[+] default POC to userid - readonly V0 +[+] change number to identifier V0 +[+] change ids to userid@nnn V0 +[+] change ned to ip address V0 +[+] add userid to preferences V1 +[+] identifier is required - display in tree V0 +[+] need to set rootitem if we bring up editor without logging in V0 +[+] identifier to be projcode + doc-type + number V1 +[+] filename - interim - oid.tsv V1 vkeech/waterbug +[+] /usr/local/data/files/partslist - server location V0 +[+] authentication in every server call V1 4jan02 vkeech/waterbug +[+] create cfg file if file is corrupt V0 +[+] need db refresh V1 12feb02 vkeech +[+] weird icon image V0 +[+] configure server to upload files V1 29jan02 waterbug +[+] multiple pl creation bug V1 +[+] menu to flush/clean ZODB V1 +[+] combobox with local/servername V1 +[+] make drag/drop not use ctrl key V1 +[+] move this list to misspiggy V1 +[+] V1 +[+] as userid -> popup dialog to prompt V1 +[+] add project as root node V1 +[+] set all menuids to wxnewid V0 +[+] make itemeditframe all the same - w/tree V1 +[+] make sure debug level is initially set V1 +[+] bug when editing non-root node after page swapping V1 +[+] merge plm/psm tool menuitems to file/tools V1 +[+] add search to tools menu V1 +[+] right button mouse menu on tree V1 +[+] need dialog to change server V1 waterbug +[+] Add "Done" button to editframe + add to grid V1 +[+] move ZODB to data directory, add temp dir V1 +[+] add working cursor when popping up editframe V1 +[+] gui problem with getmystuff V1 19dec01 vkeech +[+] dclick on grid pops up the item editor V1 20dec01 vkeech +[+] add Edit Component option to rclick menu on tree V1 20dec01 vkeech +[+] create new toplevel node by allowing drop onto project V1 21dec01 vkeech +[+] query for uncommitted data on logout V1 15jan02 vkeech +[+] add parts tab and partslist view button to itemeditframe V1 15jan02 vkeech +[+] upload partslist part data file to server V1 29jan02 waterbug/vkeech +[+] export partslist part data from grid to Excel file V1 vkeech +[+] retrieve partslist part data from server V1 29jan02 vkeech/waterbug +[+] display partslist part data in grid V1 vkeech +[+] change "Attributes" to "Component" on itemeditframe V1 16jan02 vkeech +[+] Remove module buttons from buttonbar V1 22jan02 vkeech +[+] save creates a new object V1 vkeech +[+] check scripts and rdb files for owner:group V1 waterbug/vkeech +[+] click on partlist tree updates partslistview V1 vkeech +[+] click on partlistview draws doctree V1 vkeech +[+] parts List panel: Type not being filled in browse mode V1 vkeech +[+] parts List Data grid: improve performance of rendering V1 vkeech +[+] component Tool: deactivate pull-downs for Type and Crit Code when V1 13feb02 vkeech + in read-only mode +[+] fix > 2000 rows in grid V1 12feb02 vkeech +[+] dclick on tree/grid item should pop up editor in browse mode V1 13feb02 vkeech +[+] remove filename from partslist metadata V1 vkeech +[+] resize partslistgrid after loading data V1 16feb02 vkeech +[+] optimize partslist file load V1 21feb02 vkeech +[+] add properties tab to itemeditframe V1 vkeech +[+] create properties files named .properties in files/properties V1? 28mar02 vkeech/waterbug +[+] use different directories on download of parts lists and properties V1+ 28mar02 vkeech/waterbug +[+] userid is not displayed on the local cache window; check all windows V1 22feb02 vkeech +[+] dragndrop doesn't work for toplevel items V1 01mar02 vkeech +[+] itemeditframe is not filled in with item data V1 vkeech +[+] dragndrop messed up from grid to tree V1 01mar02 vkeech +[+] component editor should not access server in local mode V1? 06mar02 vkeech +[+] new component/partslist should come up in creating mode V1? vkeech +[+] items dropped onto editframe should not have plusses V1? 05mar02 vkeech +[+] change wording on Component Tool panel V1? 11mar02 vkeech + from: "You can add or delete links to its subcomponents" + to: "You can add or delete its subcomponents" + (we know you add/del links, but end-user adds/dels subcomponents) +[+] ? V1? 15mar02 vkeech +[+] V1? 11mar02 vkeech +[+] in PLM, make Data Options guess data location based on Column Options V1? 12mar02 vkeech + (right now, Data Options guesses that data begins in row 2 regardless of + what Column Label Options is set to, e.g. even if headers span 4 cols) +[+] change name of Column Options tab to "Column Mapping" V1? 12mar02 vkeech +[+] specified in C.L.O. V1? Before vkeech + (right now, it is reading column labels from row 1 only, regardless + of what Column Label Options is set to -- it needs to "unwrap" the + labels, if they span rows, and show each label as a single line in map) +[+] change name of Import a Parts List to "Import Parts List Data" V1? 13mar02 vkeech +[+] each step in PL import needs a progress bar (with a big parts list TBD V1? + file, the data loading for each step can take several seconds) +[+] need better display for mapping -- maybe show it in a grid V1 26mar02 vkeech +[+] make sure itemeditframe is updated from main window ops V1? 21mar02 vkeech +[+] V1+ 21mar02 vkeech +[+] in spreadsheet conversion, either dismiss window when done or V1? 28mar02 vkeech + pop up a window saying "Conversion completed." with an OK button, + which dismisses itself and the conversion window (for now, at least :^) +[+] on Import Parts List Data, eliminate Select Spreadsheet panel, V1+ 28mar02 vkeech + and instead bring up a file selection dialog when the Import Parts List + Data button is pushed. +[+] on Import Parts List Data / Data Options panel, select the row V1? 13mar02 vkeech + that has been guessed as the first data row (and update it to keep in + sync with the row number selected in the panel above it) +[+] builds tree of new's V1+ 21mar02 vkeech +[+] only display mapped columns - not all of them V1+ 21mar02 vkeech +[+] remove status textfield from plm pages; use status bar V1+ 28mar02 vkeech -[-] Set up regular 'ANALYZE' process for PgerDb (Steve) -[-] Implement WF serialization using XPDL (XML Process Def. Lang.) (Ginny) +[-] enforce data types when importing, exporting, and/or TBD V1 + mapping parts list data from/to spreadsheets + (note: currently, all pl data columns except quantity are text) +[-] modify upload to differentiate between filetypes InProgress V1+ +[-] edit should put new object in hierarchy InProgress V1+ +[-] make html frame for viewing html based docs TBD V1+ +[-] Add Admin tools TBD V1+ +[-] make 'version' visible in grid and forms Testing V1 +[-] more unit tests!! TBD V1+ +[-] onProjectClick should make sure that cell (0,0) is visible TBD TBD +[-] set up regular 'ANALYZE' process for PgerDb (Steve) +[-] implement WF serialization using XPDL (XML Process Def. Lang.) (Ginny) +[-] modify objectreport.py to use possibly customized grid order for report (Steve) +[-] new demo script (Steve) +[-] upload parts list and assoc with item +[-] edit parts list in grid in PLM InProgress V1 vkeech +[-] add nodetype to tree data +[-] call count script prior to item retrieval for grid creation/fill OBE V1 +[-] call count script prior to parts list retrieval for grid creation/fill TBD V1+ +[-] gauge to display progress whereever needed TBD V1+ -------------------------------------------------------------------------- -# $Id: NEWTASKS,v 1.1 2004/03/08 21:05:42 waterbug Exp $ +# $Id: NEWTASKS,v 1.2 2004/08/26 22:38:28 waterbug Exp $ Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.150 PanGalactic/pangalactic/utils/datamanager.py:1.151 --- PanGalactic/pangalactic/utils/datamanager.py:1.150 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Thu Aug 26 18:38:30 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.150 2004/08/25 07:57:02 waterbug Exp $ +# $Id: datamanager.py,v 1.151 2004/08/26 22:38:30 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.150 $ +@version: $Revision: 1.151 $ """ -__version__ = "$Revision: 1.150 $"[11:-2] +__version__ = "$Revision: 1.151 $"[11:-2] import time import mx.DateTime @@ -188,6 +188,13 @@ self.localDB.setDisplayConfig(config) + def getDict(self, collection): + """ + Wrapper for localdb.getDict + """ + return self.localDB.getDict(collection) + + def getRoles(self): return self.localDB.getDict(self.localDB.ROLE) @@ -492,13 +499,14 @@ return obj - def getLocalAcus(self, currentproject = None): return self.localDB.GetLocalAcus(currentproject) + def getAcuByComponent(self, obj, project = None): return self.localDB.GetAcuByComponent(obj, project) + def getLinkedObjsByAcu(self, tmp_obj): # build the list of objects to send back to the server for linkup project_objs = [] @@ -519,27 +527,21 @@ Retrieves all of the Acus associated with a list of assembly ids. """ # print "datamanager.getnauobyassemblyid" - retlist = [] objlist = [] - for id in assemblyIds: temp_obj = self.localDB.getLookupObject(id) if not temp_obj: return - objlist = self.getLinkedObjsByAcu(temp_obj) if not objlist: return [] - nauoobjs = [] itemobjs = [] modelobjs = [] - for obj in objlist: if obj.isEmpty(): continue - classname = obj.__class__.__name__ if classname == "Acu": nauoobjs.append(obj) @@ -548,29 +550,21 @@ itemobjs.append(obj) elif classname == "Model": modelobjs.append(obj) -# else: -# print "ignoring linked", classname - if len(nauoobjs) > 0: updatedacuobjs = [] nauoids = [] updatedacuobjs = self.localDB.save(nauoobjs) # print "updatedacuobjs", updatedacuobjs - # add the nauos to the projectobject dictionary in localdb self.localDB.addProjectObjects(self.CurrentProject.id, nauoobjs) - if len(itemobjs) > 0: self.localDB.save(itemobjs) - break # only do the first one for now - for obj in objlist: classname = obj.__class__.__name__ if classname in ["Acu", "Part", "Model"]: item = self.localDB.getLookupObject(obj.pgef_oid) retlist.append(item) - # print "end datamanager.getnauobyassemblyid" return retlist Index: PanGalactic/pangalactic/utils/configuregrid.py diff -u PanGalactic/pangalactic/utils/configuregrid.py:1.8 PanGalactic/pangalactic/utils/configuregrid.py:1.9 --- PanGalactic/pangalactic/utils/configuregrid.py:1.8 Mon Jul 19 16:07:49 2004 +++ PanGalactic/pangalactic/utils/configuregrid.py Thu Aug 26 18:38:30 2004 @@ -1,45 +1,40 @@ -#!/bin/env python -#---------------------------------------------------------------------------- -# Name: configuregrid.py -# Author: -# Created: -# Copyright: -#---------------------------------------------------------------------------- +# $Id: configuregrid.py,v 1.9 2004/08/26 22:38:30 waterbug Exp $ + +__version__ = "$Revision: 1.9 $"[11:-2] from wxPython.wx import * from wxPython.lib.mixins.listctrl import wxColumnSorterMixin from pangalactic.utils.configuredisplay import ConfigureDisplay -from pangalactic.utils.localdb import * -#import pprint +# import pprint class ConfigureGrid(ConfigureDisplay, wxColumnSorterMixin): def __init__(self, parent, id, - pos = wxPyDefaultPosition, - size = wxPyDefaultSize, - style = wxTAB_TRAVERSAL, - localdb = None, - collection_name = None, - current_config = None): + pos=wxPyDefaultPosition, + size=wxPyDefaultSize, + style=wxTAB_TRAVERSAL, + dm=None, + collection_name=None, + current_config=None): ConfigureDisplay.__init__(self, parent, id, pos, size, style) print "configgrid.init" self.collection_name = collection_name - self.localDB = localdb + self.dm = dm if current_config: self.current_config = current_config else: - self.current_config = self.localDB.getDisplayConfig() + self.current_config = self.dm.getDisplayConfig() -# pprint.pprint(self.current_config) + # pprint.pprint(self.current_config) self.Setup() EVT_BUTTON(self, wxID_CANCEL, self.OnCancel) def Setup(self): - #print "configgrid.setup" + # print "configgrid.setup" self.attr_list = self.CreateAttributeList() wgt = self.GetAvailableWgt() wgt.ClearAll() @@ -72,7 +67,7 @@ """Creates the list of all available attribute names in the entire collection""" print "configgrid.createattributelist", self.collection_name temp = {} - collection = self.localDB.getDict(self.collection_name) + collection = self.dm.getDict(self.collection_name) for obj_id, obj in collection.items(): if isinstance(obj, types.StringType): temp["id"] = "" @@ -97,22 +92,26 @@ # Get the list of tuples that are attr name and display name if self.current_config.has_key(self.collection_name): selections = self.current_config[self.collection_name] -# pprint.pprint(selections) + # pprint.pprint(selections) - #loop through the list and set the item as selected in the available listctrl + # loop through the list and set the item as selected in the + # available listctrl availwgt = self.GetAvailableWgt() shownwgt = self.GetShownWgt() for attrname, dispname, atype in selections: ndx = availwgt.FindItem(-1, attrname) if ndx >= 0: - availwgt.SetItemState (ndx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) + availwgt.SetItemState (ndx, + wxLIST_STATE_SELECTED, + wxLIST_STATE_SELECTED) - #move all the selected entries to the shown listctrl + # move all the selected entries to the shown listctrl self.MoveSelections(availwgt, shownwgt) else: - print "YIKES!", attrname, dispname, atype, "not found. Is it a property?" + msg = "not found. Is it a property?" + print "YIKES!", attrname, dispname, atype, msg - #once again loop the list and put the display name into the grid + # once again loop the list and put the display name into the grid for attrname, dispname, atype in selections: ndx = shownwgt.FindItem(-1, attrname) if ndx >= 0: @@ -131,11 +130,11 @@ disp_list[ndx] = dlist self.current_config[self.collection_name] = disp_list # pprint.pprint(self.current_config) - self.localDB.setDisplayConfig(self.current_config) + self.dm.setDisplayConfig(self.current_config) def GetDisplayList(self): - #print "configgrid.getdisplaylist" + # print "configgrid.getdisplaylist" numrows = self.grid.GetNumberRows() temp = [] for row in range(numrows): Index: PanGalactic/pangalactic/utils/basegrid.py diff -u PanGalactic/pangalactic/utils/basegrid.py:1.36 PanGalactic/pangalactic/utils/basegrid.py:1.37 --- PanGalactic/pangalactic/utils/basegrid.py:1.36 Wed Aug 18 19:39:09 2004 +++ PanGalactic/pangalactic/utils/basegrid.py Thu Aug 26 18:38:30 2004 @@ -1,13 +1,13 @@ -# $Id: basegrid.py,v 1.36 2004/08/18 23:39:09 waterbug Exp $ +# $Id: basegrid.py,v 1.37 2004/08/26 22:38:30 waterbug Exp $ """ Wrapper for the grid that adds the drag and drop functionality to the base grid class. Also adds the ability to set the labels for the grid columns and to fill a row of data given the data in a list format -@version: $Revision: 1.36 $ +@version: $Revision: 1.37 $ """ -__version__ = "$Revision: 1.36 $"[11:-2] +__version__ = "$Revision: 1.37 $"[11:-2] import cPickle import os @@ -24,8 +24,7 @@ from pangalactic.utils import pgefdatatable from pangalactic.utils import toolframe from pangalactic.utils import objectviewer - -from pangalactic.utils.configuregrid import * +from pangalactic.utils.configuregrid import ConfigureGrid from pangalactic.enterprise.pgefobject import PgefObject @@ -74,7 +73,7 @@ "Generate PDF for this table...")] RightClickMenuOptions = [] - def __init__(self, parent, id, classname=None, localdb=None, intable=None): + def __init__(self, parent, id, classname=None, dm=None, intable=None): wxGrid.__init__(self, parent, id) # single row column labels + extra for larger font self.SetColLabelSize(30) @@ -85,14 +84,14 @@ self.vertical_offset = 0 - self.localDB = localdb + self.dm = dm if intable: self.table = intable else: self.table = pgefdatatable.PgefDataTable() self.classname = classname - self.current_config = self.localDB.getDisplayConfig() + self.current_config = self.dm.getDisplayConfig() self.table.setDisplayMap(self.current_config[classname]) self.SetTable(self.table, True) @@ -345,7 +344,7 @@ self.EndBatch() - def DumpToPdf(self, event = None): + def DumpToPdf(self, event=None): gridrows = self.GetNumberRows() if gridrows <= 0: return @@ -378,9 +377,9 @@ self.table._data, title, footer, - orientation = page_orientation, - tabular = tabular, - hidegridlines = hide_gridlines) + orientation=page_orientation, + tabular=tabular, + hidegridlines=hide_gridlines) temp.current_config = self.current_config[self.classname] fn = temp.generate() @@ -410,13 +409,13 @@ outfile.close() - def ConfigGrid(self, event = None): + def ConfigGrid(self, event=None): #print "basegrid.configgrid" tmpsize = wxSize(750, 500) gridframe = wxDialog(self, -1, "Customize Grid Layout", wxDefaultPosition, tmpsize, - style = wxCAPTION | wxSYSTEM_MENU | wxTHICK_FRAME ) + style=wxCAPTION|wxSYSTEM_MENU|wxTHICK_FRAME ) if not len(self.table._data) > 0: gridframe = None @@ -424,9 +423,9 @@ return gridframe.mainpanel = ConfigureGrid(gridframe, -1, - localdb = self.localDB, - collection_name = self.classname, - current_config = self.current_config) + dm=self.dm, + collection_name=self.classname, + current_config=self.current_config) gridframe.CentreOnParent() result = gridframe.Show(True) if result == wxID_OK: @@ -434,7 +433,7 @@ self.RefreshDisplay(displaymap) self.WriteDisplay(displaymap) self.current_config[self.classname] = displaymap - self.localDB.setDisplayConfig(self.current_config) + self.dm.setDisplayConfig(self.current_config) def RefreshDisplay(self, displaymap): @@ -464,7 +463,7 @@ return None - def getObject(self, row = None): + def getObject(self, row=None): return self.table.getObject(row) @@ -511,7 +510,7 @@ self.Refresh() menu.Append(sortID, "Sort Column") - def sort(event, self = self, col = self.sort_column): + def sort(event, self=self, col=self.sort_column): self.table.sortColumn(col) # reselect the previously selected object, if any Index: PanGalactic/pangalactic/utils/dbbrowser.py diff -u PanGalactic/pangalactic/utils/dbbrowser.py:1.29 PanGalactic/pangalactic/utils/dbbrowser.py:1.30 --- PanGalactic/pangalactic/utils/dbbrowser.py:1.29 Wed Aug 18 19:39:10 2004 +++ PanGalactic/pangalactic/utils/dbbrowser.py Thu Aug 26 18:38:30 2004 @@ -1,5 +1,5 @@ #!/bin/env python -# $Id: dbbrowser.py,v 1.29 2004/08/18 23:39:10 waterbug Exp $ +# $Id: dbbrowser.py,v 1.30 2004/08/26 22:38:30 waterbug Exp $ #---------------------------------------------------------------------------- # Name: dbbrowser.py # Author: Ginny @@ -7,9 +7,9 @@ """ PanGalactic object browser for ZODB -@version: $Revision: 1.29 $ +@version: $Revision: 1.30 $ """ -__version__ = "$Revision: 1.29 $"[11:-2] +__version__ = "$Revision: 1.30 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -32,9 +32,12 @@ #import pprint DEBUG = 1 - ID_POPUP_CLEAR_SELECTION = wxNewId() OBJECT_VIEWER = wxNewId() +# classes excluded from configurability: +EXCLUDE_CLASSES = ["DisplayConfig", "Passwd", "UncommittedDocumentIDs", + "OidLookup"] + class zodbbrowser(wxPanel): @@ -42,11 +45,12 @@ (ID_POPUP_CLEAR_SELECTION, "Clear Selection")] RightClickMenuOptions = [] - def __init__(self, parent, id, localdb, + def __init__(self, parent, id, dm, pos=wxDefaultPosition, size=wxDefaultSize): wxPanel.__init__(self, parent, id, pos, size, style=wxTHICK_FRAME) self.Parent = parent - self.localDB = localdb + self.dm = dm + self.localDB = dm.localDB self.dbfile = None self.current_config = {} ZODBBrowserFunc(self, True) @@ -92,17 +96,19 @@ def GetGrid(self): return wxPyTypeCast(self.FindWindowById(ID_GRID), "wxGrid") - def FillChoice(self, config = localdb.god): + def FillChoice(self, config=99): + # TODO: config=99 is because of localdb cruft -- it just means + # "display everything you can" ("god" access); need to make this + # configurable by user (prefs) ... probably doesn't need to be an + # argument to FillChoice, as it will be determined by prefs. choice = self.GetRootitems() choice.Clear() - items = [] if config: for dictname, clearflag, config_access in self.localDB.dictlist: if config_access <= config: items.append(dictname) items.sort() - choice.InsertItems(items, 0) @@ -152,9 +158,9 @@ tmpsize) cfg_frame.mainpanel = configuregrid.ConfigureGrid( cfg_frame, -1, - localdb = self.localDB, - collection_name = collection_name, - current_config = self.current_config) + dm=self.dm, + collection_name=collection_name, + current_config=self.current_config) cfg_frame.CentreOnParent() cfg_frame.Show(True) @@ -280,7 +286,7 @@ self.grid.DeleteRows(0, self.grid.GetNumberRows()) selection = self.GetRootitems().GetStringSelection() - if selection in localdb.EXCLUDE_CLASSES: + if selection in EXCLUDE_CLASSES: print selection, "is not configurable" self.GetConfigWgt().Enable(False) else: @@ -343,7 +349,7 @@ classname = attrvalue.__class__.__name__ #if classname in localdb.NARS_CLASSES: # val = attrvalue.id + "(" + attrvalue.getPrettyDocType() + ")" - if classname in self.localDB._registry.pgef_classes: + if classname in self.dm._registry.pgef_classes: val = attrvalue.id + " (" + classname + ")" elif (isinstance(attrvalue, types.DictType) or @@ -354,7 +360,7 @@ else: attrclass = attrvalue[attrvalue.keys()[0]].__class__.__name__ #if (attrclass in localdb.NARS_CLASSES or - if attrclass in self.localDB._registry.pgef_classes: + if attrclass in self.dm._registry.pgef_classes: val = str(len(attrvalue)) + " elements" #except: # val = "N/A" Index: PanGalactic/pangalactic/utils/orggrid.py diff -u PanGalactic/pangalactic/utils/orggrid.py:1.3 PanGalactic/pangalactic/utils/orggrid.py:1.4 --- PanGalactic/pangalactic/utils/orggrid.py:1.3 Mon Jun 21 14:17:38 2004 +++ PanGalactic/pangalactic/utils/orggrid.py Thu Aug 26 18:38:30 2004 @@ -37,8 +37,8 @@ """wrapper for the grid that adds the drag and drop functionality to the base grid class. Also adds the ability to set the labels for the grid columns and to fill a row of data given the data in a list format""" - def __init__(self, parent, id, classname = None, localdb = None, intable = None): - basegrid.BaseGrid.__init__(self, parent, id, classname, localdb, intable) + def __init__(self, parent, id, classname=None, dm=None, intable = None): + basegrid.BaseGrid.__init__(self, parent, id, classname, dm, intable) self.EnableEditing(False) def StartDragOperation(self, selectedrow): Index: PanGalactic/pangalactic/utils/pdfoptions.py diff -u PanGalactic/pangalactic/utils/pdfoptions.py:1.5 PanGalactic/pangalactic/utils/pdfoptions.py:1.6 --- PanGalactic/pangalactic/utils/pdfoptions.py:1.5 Thu Jun 3 14:36:14 2004 +++ PanGalactic/pangalactic/utils/pdfoptions.py Thu Aug 26 18:38:30 2004 @@ -1,4 +1,9 @@ +# $Id: pdfoptions.py,v 1.6 2004/08/26 22:38:30 waterbug Exp $ + +__version__ = "$Revision: 1.6 $"[11:-2] + from wxPython.wx import * + ID_PDF_FILENAME = wxNewId() ID_PDF_BROWSE = wxNewId() ID_PDF_TITLE = wxNewId() @@ -86,4 +91,4 @@ self.filename.SetValue(dlg.GetPath()) dlg.Destroy() - + Index: PanGalactic/pangalactic/utils/usersearchframe.py diff -u PanGalactic/pangalactic/utils/usersearchframe.py:1.7 PanGalactic/pangalactic/utils/usersearchframe.py:1.8 --- PanGalactic/pangalactic/utils/usersearchframe.py:1.7 Tue Aug 17 11:47:57 2004 +++ PanGalactic/pangalactic/utils/usersearchframe.py Thu Aug 26 18:38:30 2004 @@ -1,10 +1,10 @@ -# $Id: usersearchframe.py,v 1.7 2004/08/17 15:47:57 waterbug Exp $ +# $Id: usersearchframe.py,v 1.8 2004/08/26 22:38:30 waterbug Exp $ """ wx frame for doing searches for users. -@version: $Revision: 1.7 $ +@version: $Revision: 1.8 $ """ -__version__ = "$Revision: 1.7 $"[11:-2] +__version__ = "$Revision: 1.8 $"[11:-2] from wxPython.wx import * @@ -40,8 +40,8 @@ self.resultsgrid = usergrid.UserGrid(self.searchnb, self.USER_SEARCH_GRID, - classname = "Person", - localdb = self.dm.localDB) + classname="Person", + dm=self.dm) self.resultsgrid.allow_config_flag = False # at least for now self.resultsgrid.SetRowLabelSize(0) Index: PanGalactic/pangalactic/utils/usergrid.py diff -u PanGalactic/pangalactic/utils/usergrid.py:1.4 PanGalactic/pangalactic/utils/usergrid.py:1.5 --- PanGalactic/pangalactic/utils/usergrid.py:1.4 Mon Jun 21 14:17:38 2004 +++ PanGalactic/pangalactic/utils/usergrid.py Thu Aug 26 18:38:30 2004 @@ -41,8 +41,8 @@ """wrapper for the grid that adds the drag and drop functionality to the base grid class. Also adds the ability to set the labels for the grid columns and to fill a row of data given the data in a list format""" - def __init__(self, parent, id, classname = None, localdb = None, intable = None): - basegrid.BaseGrid.__init__(self, parent, id, classname, localdb, intable) + def __init__(self, parent, id, classname=None, dm=None, intable = None): + basegrid.BaseGrid.__init__(self, parent, id, classname, dm, intable) self.EnableEditing(False) self.RightClickMenuOptinos = [(USER_DISABLE, "Disable"), (USER_ENABLE, "Enable"), From waterbug at ned.gsfc.nasa.gov Fri Aug 27 01:42:37 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 27 01:42:40 2004 Subject: [Pangalactic-commits] Further adventures of the "state" dictionary ... Message-ID: <200408270542.i7R5gbZL013751@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/client/pangalaxian.py 1.8 1.9 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py 1.14 1.15 PanGalactic/pangalactic/client/modules/plm/plmtool.py 1.25 1.26 PanGalactic/pangalactic/client/modules/psm/docform.py 1.11 1.12 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py 1.41 1.42 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py 1.42 1.43 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py 1.155 1.156 PanGalactic/pangalactic/client/modules/psm/modelform.py 1.15 1.16 PanGalactic/pangalactic/client/modules/psm/otherdocform.py 1.30 1.31 PanGalactic/pangalactic/client/modules/psm/partform.py 1.15 1.16 PanGalactic/pangalactic/client/modules/psm/partslistform.py 1.41 1.42 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py 1.41 1.42 PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py 1.30 1.31 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py 1.46 1.47 PanGalactic/pangalactic/client/modules/psm/pgeftree.py 1.42 1.43 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py 1.22 1.23 PanGalactic/pangalactic/client/modules/psm/psmtool.py 1.185 1.186 PanGalactic/pangalactic/client/tests/test_itemeditframe.py 1.19 1.20 PanGalactic/pangalactic/client/tests/test_psmtool.py 1.5 1.6 PanGalactic/pangalactic/enterprise/pgefobject.py 1.72 1.73 PanGalactic/pangalactic/utils/datamanager.py 1.151 1.152 PanGalactic/pangalactic/utils/localdb.py 1.109 1.110 PanGalactic/pangalactic/utils/usersearchframe.py 1.8 1.9 Log message: Further adventures of the "state" dictionary ... - getting rid of local & "passed-around" states in favor of using the state dict - renamed some state aspects ("current" seems redundant, since that's what "state" *means*, isn't it?) ... - currentproject -> project - currentserver -> server - currentuserid -> userid Index: PanGalactic/pangalactic/client/tests/test_psmtool.py diff -u PanGalactic/pangalactic/client/tests/test_psmtool.py:1.5 PanGalactic/pangalactic/client/tests/test_psmtool.py:1.6 --- PanGalactic/pangalactic/client/tests/test_psmtool.py:1.5 Fri Mar 5 16:18:12 2004 +++ PanGalactic/pangalactic/client/tests/test_psmtool.py Fri Aug 27 01:42:04 2004 @@ -49,7 +49,7 @@ testframe.dm.creatingItem = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.dm.CurrentProject = 'TEST' testframe.itemeditform = modules.psm.itemeditframe.ItemEditFrame(testframe.psmtool, testframe.State, 0, 1, nodedata, testframe.dm) Index: PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.41 PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.42 --- PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py:1.41 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/documenttreeframe.py Fri Aug 27 01:42:03 2004 @@ -15,7 +15,7 @@ from pangalactic.utils import objectstatus from pangalactic.utils.preferences import prefs, writePrefs -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] class DocumentTreeFrame(doctreeframe.DocTreeFrame): @@ -103,7 +103,7 @@ dfile.state = objectstatus.ADD self.dm.save([newdoc, dfile]) - self.dm.addProjectObjects(state['currentproject'], + self.dm.addProjectObjects(state['project'], [newdoc, dfile]) if self.EditMode: self.EditMode = False Index: PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py diff -u PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.42 PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.43 --- PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py:1.42 Thu Aug 26 18:38:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemdroptarget.py Fri Aug 27 01:42:03 2004 @@ -1,4 +1,4 @@ -# $Id: itemdroptarget.py,v 1.42 2004/08/26 22:38:29 waterbug Exp $ +# $Id: itemdroptarget.py,v 1.43 2004/08/27 05:42:03 waterbug Exp $ import cPickle @@ -11,7 +11,7 @@ from wxPython.wx import wxPoint, wxTreeItemIcon_Selected -__version__ = "$Revision: 1.42 $"[11:-2] +__version__ = "$Revision: 1.43 $"[11:-2] #constants @@ -142,10 +142,10 @@ elif DragFromGrid: #print "drag from grid" targetitem = self.dm.getLookupObject(targetdata[1]) - #print 'project is: ', state['currentproject'] + #print 'project is: ', state['project'] targetnauo = self.dm.getAcuByComponent(targetitem, - state['currentproject']) + state['project']) #print '******** targetitem is', targetitem.id #print '******** targetnauo is', targetnauo @@ -175,11 +175,11 @@ newnauo = Acu(subtype = 'nauo') newnauo.component = dropitem newnauo.state = objectstatus.ADD - newnauo.initObject(state['currentproject'], self.dm.user.id) + newnauo.initObject(state['project'], self.dm.user.id) if haverootnode: #print "haverootnode; assembly is TOPLEVEL" - tlobj = Model(project = state['currentproject']) + tlobj = Model(project = state['project']) #tlobj.pgef_oid = "TOPLEVEL" ## wtf???? vwk newnauo.assembly = tlobj else: Index: PanGalactic/pangalactic/utils/usersearchframe.py diff -u PanGalactic/pangalactic/utils/usersearchframe.py:1.8 PanGalactic/pangalactic/utils/usersearchframe.py:1.9 --- PanGalactic/pangalactic/utils/usersearchframe.py:1.8 Thu Aug 26 18:38:30 2004 +++ PanGalactic/pangalactic/utils/usersearchframe.py Fri Aug 27 01:42:05 2004 @@ -1,10 +1,10 @@ -# $Id: usersearchframe.py,v 1.8 2004/08/26 22:38:30 waterbug Exp $ +# $Id: usersearchframe.py,v 1.9 2004/08/27 05:42:05 waterbug Exp $ """ wx frame for doing searches for users. -@version: $Revision: 1.8 $ +@version: $Revision: 1.9 $ """ -__version__ = "$Revision: 1.8 $"[11:-2] +__version__ = "$Revision: 1.9 $"[11:-2] from wxPython.wx import * @@ -22,7 +22,7 @@ toolframe.toolFrame.__init__(self, parent, id, title, size=size) self.Parent = parent self.SetDataManager(datamanager) - self.sb.SetUser(state['currentuserid']) + self.sb.SetUser(state['userid']) self.curr_user = None self.user_frame = None Index: PanGalactic/pangalactic/client/pangalaxian.py diff -u PanGalactic/pangalactic/client/pangalaxian.py:1.8 PanGalactic/pangalactic/client/pangalaxian.py:1.9 --- PanGalactic/pangalactic/client/pangalaxian.py:1.8 Thu Aug 26 18:38:28 2004 +++ PanGalactic/pangalactic/client/pangalaxian.py Fri Aug 27 01:42:02 2004 @@ -1,13 +1,13 @@ #!/usr/bin/env python -# $Id: pangalaxian.py,v 1.8 2004/08/26 22:38:28 waterbug Exp $ +# $Id: pangalaxian.py,v 1.9 2004/08/27 05:42:02 waterbug Exp $ """ Main application module for the PGEF desktop client. -@version: $Revision: 1.8 $ +@version: $Revision: 1.9 $ """ -__version__ = "$Revision: 1.8 $"[11:-2] +__version__ = "$Revision: 1.9 $"[11:-2] from wxPython.wx import * from wxPython.grid import * @@ -185,14 +185,14 @@ # make sure some defaults are set state['workingdir'] = workingdir state['loggedin'] = '' - # set state['currentserver'] and state['serverlist'] from + # set state['server'] and state['serverlist'] from # existing states and prefs, if any - currentserver = (state.get('currentserver', None) + server = (state.get('server', None) or prefs.get('server', 'localhost:8080')) - state['currentserver'] = currentserver - serverlist = [currentserver] + state['server'] = server + serverlist = [server] if (prefs.get('server', None) - and prefs['server'] != currentserver): + and prefs['server'] != server): serverlist.append(prefs['server']) if state.get('serverlist', None): for srv in state['serverlist']: @@ -312,17 +312,20 @@ id=prefs.get('userid', useroid), email=prefs.get('email', 'local')) print 'PanGalaxian: userid =', self.user.id - state['currentuserid'] = self.user.id + state['userid'] = self.user.id oid.setOidBase(useroid) - state['currentproject'] = state.get('lastproject', + state['project'] = state.get('lastproject', + None) or prefs.get( + 'defaultproject', + 'NoProject') + state['id_context'] = state.get('lastproject', None) or prefs.get( 'defaultproject', 'NoProject') writeState() - print 'PanGalaxian: current project =', state['currentproject'] + print 'PanGalaxian: project =', state['project'] self.WatchDog = SecurityManager(self.user) - self.dm = DataManager(self.WatchDog, - projectid=state['currentproject']) + self.dm = DataManager(self.WatchDog) self.ActivateTool() self.onModeChange() show_tooltips = prefs.get("ShowToolTips", False) @@ -512,8 +515,8 @@ if state['loggedin']: print "\n *** logged in (non-local mode) ***\n" # GUI state changes - if state['currentuserid'] != 'admin': - self.removeSpecialMenus(state['currentuserid']) + if state['userid'] != 'admin': + self.removeSpecialMenus(state['userid']) self.menuBar.Enable(ID_PREF_PROXY, 0) self.menuBar.Enable(ID_PREF_SERVER1, 0) self.menuBar.Enable(ID_PREF_SERVER2, 0) @@ -526,12 +529,12 @@ self.menuBar.Enable(ID_PREF_PASSWD, 1) self.menuBar.Enable(ID_PREF_CLEAR_LOCALDB, 1) self.sb.SetServer(''.join(['Repository: ', - state['currentserver']])) + state['server']])) self.sb.ShowImage(True) else: print "\n *** not logged in (local mode) ***\n" # GUI state changes - self.addSpecialMenus(state['currentuserid']) + self.addSpecialMenus(state['userid']) self.menuBar.Enable(ID_FILE_LOGIN, 1) self.menuBar.Enable(ID_PREF_PROXY, 1) self.menuBar.Enable(ID_PREF_SERVER1, 1) @@ -858,7 +861,7 @@ # preference. (TODO: of course we also need a more general prefs # edit frame ;) dlg = ServerDialog(self, -1, 'Enter Server Information') - server = state['currentserver'] + server = state['server'] if server: serverhost, serverport = server.split(':') dlg.GetTextctrlHost().SetValue(serverhost) @@ -877,9 +880,9 @@ errdlg.CentreOnParent() errdlg.ShowModal() else: - state['currentserver'] = ':'.join([serverhost, serverport]) - if state['currentserver'] not in state['serverlist']: - state['serverlist'].insert(0, state['currentserver']) + state['server'] = ':'.join([serverhost, serverport]) + if state['server'] not in state['serverlist']: + state['serverlist'].insert(0, state['server']) def OnSize(self, event): @@ -967,7 +970,7 @@ def addSpecialMenus(self, user_info): if (state['loggedin'] - and state['currentuserid'] == 'admin' + and state['userid'] == 'admin' and self.AdminMenu == None): self.AddAdminMenu(self.dm.user) ######### GodMenu is temporarily disabled @@ -1007,7 +1010,7 @@ if the user logged in is an administrator. """ if (state['loggedin'] - and state['currentuserid'] == 'admin' + and state['userid'] == 'admin' and self.AdminMenu == None): self.AdminMenu = self.createAdminMenu() self.menuBar.Insert(self.SpecialPos, @@ -1060,10 +1063,10 @@ dialog.GetRepository().Clear() for entry in state['serverlist']: dialog.GetRepository().Append(entry) - i = state['serverlist'].index(state['currentserver']) + i = state['serverlist'].index(state['server']) dialog.GetRepository().SetSelection(i) dialog.CentreOnParent() - userid = prefs.get('userid', None) or state.get('currentuser', '') + userid = prefs.get('userid', None) or state.get('userid', '') dialog.GetTextctrlUsername().SetValue(userid) if userid: dialog.GetTextctrlPassword().SetFocus() @@ -1087,10 +1090,10 @@ hostport = dialog.GetRepository().GetStringSelection() loginid = dialog.GetTextctrlUsername().GetValue() loginpasswd = dialog.GetTextctrlPassword().GetValue() - state['currentserver'] = state['serverlist'][ + state['server'] = state['serverlist'][ dialog.GetRepository().GetSelection()] print ' - loginid: ', loginid - print ' - server: ', state['currentserver'] + print ' - server: ', state['server'] if (prefs.get('userid', None) and loginid == prefs['userid']): self.dm.user._password = loginpasswd @@ -1108,7 +1111,7 @@ dialog.Destroy() still_trying = False state['loggedin'] = '1' - state['currentuserid'] = loginid + state['userid'] = loginid self.onModeChange() if prefs.get('ShowLoginConfirmed', None): sdlg = wxMessageDialog(self, Index: PanGalactic/pangalactic/client/modules/plm/epimsmapping.py diff -u PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.14 PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.15 --- PanGalactic/pangalactic/client/modules/plm/epimsmapping.py:1.14 Tue Aug 17 11:47:55 2004 +++ PanGalactic/pangalactic/client/modules/plm/epimsmapping.py Fri Aug 27 01:42:02 2004 @@ -52,7 +52,7 @@ self.SelectedRow = None if state['loggedin']: - self.sb.SetServer(state['currentserver']) + self.sb.SetServer(state['server']) else: self.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/plm/plmtool.py diff -u PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.25 PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.26 --- PanGalactic/pangalactic/client/modules/plm/plmtool.py:1.25 Tue Aug 17 11:47:55 2004 +++ PanGalactic/pangalactic/client/modules/plm/plmtool.py Fri Aug 27 01:42:02 2004 @@ -642,7 +642,7 @@ if self.dm: if state['loggedin']: - self.EpimsMappingFrame.sb.SetServer(state['currentserver']) + self.EpimsMappingFrame.sb.SetServer(state['server']) else: self.EpimsMappingFrame.sb.ClearServer() Index: PanGalactic/pangalactic/client/tests/test_itemeditframe.py diff -u PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.19 PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.20 --- PanGalactic/pangalactic/client/tests/test_itemeditframe.py:1.19 Thu Aug 12 17:25:17 2004 +++ PanGalactic/pangalactic/client/tests/test_itemeditframe.py Fri Aug 27 01:42:03 2004 @@ -56,7 +56,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingPartsList = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 2, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) @@ -88,7 +88,7 @@ testframe.dm.getProjects() testframe.dm.localDB.Commit() nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) testframe.itemeditform.pmm_pmv_form.FillFormWithPMVData(tempitem) @@ -114,7 +114,7 @@ testframe.dm.localDB.Commit() nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.dm.creatingItem = 1 testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) @@ -144,7 +144,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingItem = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.dm.localDB.Commit() @@ -174,7 +174,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingPartsList= 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 2, 1, nodedata, testframe.dm) testframe.dm.localDB.Commit() @@ -199,7 +199,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingItem = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) @@ -227,7 +227,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingItem = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.dm.localDB.SaveItem([tempitem]) testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) @@ -256,7 +256,7 @@ testframe.dm.localDB.Commit() testframe.dm.creatingItem = 1 nodedata = (None, None) - testframe.State.currentproject = 'TEST' + projectid = 'TEST' testframe.dm.localDB.SaveItem([tempitem]) testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) @@ -285,7 +285,7 @@ result = testframe.dm.login('tstuser','test') testframe.dm.getProjects() testframe.dm.localDB.Commit() - testframe.State.currentproject = 'TEST' + projectid = 'TEST' nodedata = (None, None) testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) @@ -306,7 +306,7 @@ result = testframe.dm.login('tstuser','test') testframe.dm.getProjects() testframe.dm.localDB.Commit() - testframe.State.currentproject = 'TEST' + projectid = 'TEST' nodedata = (None, None) testframe.itemeditform = itemeditframe.ItemEditFrame(testframe, testframe.State, 0, 1, nodedata, testframe.dm) testframe.itemeditform.SetDisplayWgt(self.DisplayWgts) Index: PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py diff -u PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.41 PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.42 --- PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py:1.41 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslisttreeframe.py Fri Aug 27 01:42:03 2004 @@ -22,7 +22,7 @@ except: print "partslisttreeframe.plmimport.failed" -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] class PartsListTreeFrame(doctreeframe.DocTreeFrame): @@ -120,7 +120,7 @@ self.dm.add([partslist]) - self.dm.addProjectObjects(state['currentproject'], [partslist]) + self.dm.addProjectObjects(state['project'], [partslist]) if self.EditMode: # print "editpl" @@ -135,7 +135,7 @@ self.dm.refresh = True self.buildTree() else: - partslist.initObject(state['currentproject'], self.dm.user.id) + partslist.initObject(state['project'], self.dm.user.id) self.currentdocument(**partslist.__dict__) # foobar - SOAP can't handle compound subobjects - pull 'em out and put 'em elsewhere @@ -207,7 +207,7 @@ self.ImportPartsListFrame.SetDataManager(self.dm) if state['loggedin']: - self.ImportPartsListFrame.sb.SetServer(state['currentserver']) + self.ImportPartsListFrame.sb.SetServer(state['server']) else: self.ImportPartsListFrame.sb.ClearServer() Index: PanGalactic/pangalactic/client/modules/psm/otherdocform.py diff -u PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.30 PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.31 --- PanGalactic/pangalactic/client/modules/psm/otherdocform.py:1.30 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/otherdocform.py Fri Aug 27 01:42:03 2004 @@ -169,16 +169,16 @@ self.ClearForm() self.Enable(True) ctrl = self.GetAuthorWgt() - ctrl.SetValue(state['currentuserid']) + ctrl.SetValue(state['userid']) ctrl = self.GetVersionWgt() ctrl.SetValue("1") wgt = self.GetIdentifierWgt() self.NextDocId = str(int(self.NextDocId) + 1) - if not state['currentproject']: + if not state['project']: wgt.SetValue("DOC-" + self.NextDocId) else: - wgt.SetValue(''.join([state['currentproject'], + wgt.SetValue(''.join([state['project'], "-DOC-", self.NextDocId])) prefs["nextdocid"] = self.NextDocId Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.109 PanGalactic/pangalactic/utils/localdb.py:1.110 --- PanGalactic/pangalactic/utils/localdb.py:1.109 Thu Aug 26 18:38:30 2004 +++ PanGalactic/pangalactic/utils/localdb.py Fri Aug 27 01:42:05 2004 @@ -304,8 +304,8 @@ return self.dbroot[self.ACUDICT] - def GetLocalAcus(self, currentproject = None): - #print "getlocalacus", currentproject + def GetLocalAcus(self, project=None): + #print "getlocalacus", project acu_dict = self.GetACUDict() uncommitted_dict = self.GetUncommittedDict() @@ -315,7 +315,7 @@ pass else: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject: + if project and childobj.project == project: # add project_context = "DEMO" or something similar to the above line - TBD objdict[nid] = nobj @@ -324,7 +324,7 @@ if objdict.has_key(nid): if nobj.state <> objectstatus.DELETE: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject: + if project and childobj.project == project: objdict[nid] = nobj else: objdict[nid] = nobj @@ -333,7 +333,7 @@ else: if nobj.state <> objectstatus.DELETE: childobj = self.getLookupObject(nobj.component) - if currentproject and childobj.project == currentproject: + if project and childobj.project == project: objdict[nid] = nobj else: objdict[nid] = nobj @@ -359,7 +359,7 @@ return retobj - def GetLocalPartDocLinks(self, currentproject = None): + def GetLocalPartDocLinks(self, project = None): #print "getlocalpartdoclinks" pdr_dict = self.dbroot[self.DCU] uncommitted_dict = self.GetUncommittedDict() @@ -371,7 +371,7 @@ #print "skipping deleted pdr", pdrid else: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project == currentproject: + if project and parentobj.project == project: objdict[pdrid] = pdrobj for pdrid, pdrobj in uncommitted_dict.items(): @@ -379,7 +379,7 @@ if objdict.has_key(pdrid): if pdrobj.state <> objectstatus.DELETE: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project == currentproject: + if project and parentobj.project == project: objdict[pdrid] = pdrobj # else: # print "skipping pdr", pdrid @@ -390,7 +390,7 @@ else: if pdrobj.state <> objectstatus.DELETE: parentobj = self.getLookupObject(pdrobj.product) - if currentproject and parentobj.project == currentproject: + if project and parentobj.project == project: objdict[pdrid] = pdrobj # else: # print "skipping deleted pdr", pdrid @@ -399,7 +399,7 @@ return objdict - def getLocalObjectsOfTypes(self, dictnamelist, currentproject): + def getLocalObjectsOfTypes(self, dictnamelist, project): #print "localdb.getlocalobjectsoftype" dict_list = [] for dictname in dictnamelist: @@ -420,11 +420,11 @@ if tmpobj: if hasattr(tmpobj, "project"): - if currentproject and tmpobj.project == currentproject: + if project and tmpobj.project == project: # tmpobj.project = tmpobj.project objdict[nid] = tmpobj elif hasattr(tmpobj, "_project"): - if currentproject and tmpobj._project.id == currentproject: + if project and tmpobj._project.id == project: tmpobj.project = tmpobj._project.id objdict[nid] = tmpobj else: @@ -440,11 +440,11 @@ if nobj.state <> objectstatus.DELETE: #tmpobj = self.getLookupObject(nobj.pgef_oid) if hasattr(nobj, "project"): - if currentproject and nobj.project == currentproject: + if project and nobj.project == project: # nobj.project = nobj.project objdict[nid] = nobj elif hasattr(nobj, "_project"): - if currentproject and nobj._project.id == currentproject: + if project and nobj._project.id == project: nobj.project = nobj._project.id objdict[nid] = nobj else: @@ -456,12 +456,12 @@ if nobj.state <> objectstatus.DELETE: #tmpobj = self.getLookupObject(nobj.pgef_oid) if hasattr(nobj, "project"): - if currentproject and nobj.project == currentproject: + if project and nobj.project == project: # nobj.project = nobj.project objdict[nid] = nobj elif hasattr(nobj, "_project"): - if currentproject and nobj._project.id == currentproject: + if project and nobj._project.id == project: nobj.project = nobj._project.id objdict[nid] = nobj Index: PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.22 PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.23 --- PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py:1.22 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefversiontree.py Fri Aug 27 01:42:03 2004 @@ -119,7 +119,7 @@ #print "pgefversiontree: loadtreefromobjects:", rootproduct.id self.DeleteAllItems() -# self.nodeStack.append(self.AddRoot(datamanager.CurrentProject.id)) +# self.nodeStack.append(self.AddRoot(state['project'])) tmp_model = None tmp_part = None Index: PanGalactic/pangalactic/client/modules/psm/itemeditframe.py diff -u PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.155 PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.156 --- PanGalactic/pangalactic/client/modules/psm/itemeditframe.py:1.155 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/itemeditframe.py Fri Aug 27 01:42:03 2004 @@ -1,6 +1,6 @@ -# $Id: itemeditframe.py,v 1.155 2004/08/25 07:57:02 waterbug Exp $ +# $Id: itemeditframe.py,v 1.156 2004/08/27 05:42:03 waterbug Exp $ -__version__ = "$Revision: 1.155 $"[11:-2] +__version__ = "$Revision: 1.156 $"[11:-2] import copy import types @@ -562,7 +562,7 @@ link.state = objectstatus.ADD self.dm.add([link]) - self.dm.addProjectObjects(state['currentproject'], [link]) + self.dm.addProjectObjects(state['project'], [link]) rootdata = self.tree.GetPyData(self.tree.GetRootItem()) parent = self.dm.getLookupObject(rootdata[1]) @@ -756,10 +756,10 @@ link.product = "ROOT" #self.rootitemid link.document = self.currentobj.pgef_oid link.state = objectstatus.ADD - link.initObject(state['currentproject'], self.dm.user.id) + link.initObject(state['project'], self.dm.user.id) self.dm.add([link]) - self.dm.addProjectObjects(state['currentproject'], [link]) + self.dm.addProjectObjects(state['project'], [link]) node = self.partslisttree.GetSelection() rootnode = self.partslisttree.GetRootItem() @@ -876,7 +876,7 @@ self.ImportPartsListFrame.SetDataManager(self.dm) if state['mode'] != 'local': - self.ImportPartsListFrame.sb.SetServer(state['currentserver']) + self.ImportPartsListFrame.sb.SetServer(state['server']) else: self.ImportPartsListFrame.sb.ClearServer() @@ -1355,7 +1355,7 @@ self.dm.creatingDocument = False self.dm.add([save_object]) - self.dm.addProjectObjects(state['currentproject'], + self.dm.addProjectObjects(state['project'], [save_object]) self.Parent.GetPSMTool().UpdateWgts(save_object) return True @@ -1426,8 +1426,8 @@ save_object = None newitem = None - if not self.dm.CurrentProject: - print " Hmmm... No currentproject. Not Good. Aborting." + if not state['project']: + print " Hmmm... No project. Not Good. Aborting." return if self.dm.creatingPart: @@ -1516,7 +1516,7 @@ self.currentobj.__dict__.update(save_object.__dict__) self.tempobj.__dict__.update(save_object.__dict__) - self.dm.addProjectObjects(state['currentproject'], + self.dm.addProjectObjects(state['project'], [save_object]) return save_object Index: PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.30 PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.31 --- PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py:1.30 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefdoctree.py Fri Aug 27 01:42:03 2004 @@ -76,7 +76,7 @@ PdrNodes = [] highlightednode = None - localpdrs = datamanager.getPartDocLinksByProjectId(datamanager.CurrentProject.id) + localpdrs = datamanager.getPartDocLinksByProjectId(state['project']) #print "num localpdrs", len(localpdrs) if datamanager.refresh: @@ -158,7 +158,7 @@ PdrNodes = [] highlightednode = None - localpdrs = datamanager.getPartDocLinksByProjectId(datamanager.CurrentProject.id) + localpdrs = datamanager.getPartDocLinksByProjectId(state['project']) if datamanager.refresh: for pdrid, pdrobj in localpdrs.items(): #print "checking: " + pdrobj.pgef_oid + "; state: " + repr(pdrobj.state) @@ -278,7 +278,9 @@ #print "pgefalerttree: loadgeneraldocuments" self.DeleteAllItems() - docdict = datamanager.getLocalPartsLists() + # TODO: do this rationally + docdict = {} + # docdict = datamanager.getLocalPartsLists() self.nodeStack.append(self.AddRoot(rootlabel)) rootnode = self.GetRootItem() Index: PanGalactic/pangalactic/enterprise/pgefobject.py diff -u PanGalactic/pangalactic/enterprise/pgefobject.py:1.72 PanGalactic/pangalactic/enterprise/pgefobject.py:1.73 --- PanGalactic/pangalactic/enterprise/pgefobject.py:1.72 Wed Aug 25 03:37:45 2004 +++ PanGalactic/pangalactic/enterprise/pgefobject.py Fri Aug 27 01:42:04 2004 @@ -1,12 +1,12 @@ -# $Id: pgefobject.py,v 1.72 2004/08/25 07:37:45 waterbug Exp $ +# $Id: pgefobject.py,v 1.73 2004/08/27 05:42:04 waterbug Exp $ """ PgefObject is the Mother of all PanGalactic Enterprise classes. -@version: $Revision: 1.72 $ +@version: $Revision: 1.73 $ """ -__version__ = "$Revision: 1.72 $"[11:-2] +__version__ = "$Revision: 1.73 $"[11:-2] import types import string @@ -523,13 +523,13 @@ outstring += "\n" return outstring - def initObject(self, currentproject, userid): + def initObject(self, project, userid): """ Populate certain attributes of a PgefObject that should be populated at creation time. """ if hasattr(self, 'project'): - self.project = currentproject + self.project = project # project should be pushed down into specific # subtypes; doesn't make sense for all objects self.owner = userid Index: PanGalactic/pangalactic/client/modules/psm/modelform.py diff -u PanGalactic/pangalactic/client/modules/psm/modelform.py:1.15 PanGalactic/pangalactic/client/modules/psm/modelform.py:1.16 --- PanGalactic/pangalactic/client/modules/psm/modelform.py:1.15 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/modelform.py Fri Aug 27 01:42:03 2004 @@ -147,7 +147,7 @@ self.clearForm() self.Enable(True) self.CreatingModel = True - self.GetPoc().SetValue(state['currentuserid']) + self.GetPoc().SetValue(state['userid']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) Index: PanGalactic/pangalactic/client/modules/psm/psmtool.py diff -u PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.185 PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.186 --- PanGalactic/pangalactic/client/modules/psm/psmtool.py:1.185 Thu Aug 26 18:38:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/psmtool.py Fri Aug 27 01:42:03 2004 @@ -1,11 +1,11 @@ -# $Id: psmtool.py,v 1.185 2004/08/26 22:38:29 waterbug Exp $ +# $Id: psmtool.py,v 1.186 2004/08/27 05:42:03 waterbug Exp $ # Originally Created 04/05/2001 """ PSM Tool is the Product Structure Manager. It handles visualization, navigation, and editing of product structures. """ -__version__ = "$Revision: 1.185 $"[11:-2] +__version__ = "$Revision: 1.186 $"[11:-2] import os @@ -394,7 +394,7 @@ grid=currentgrid, skipcols=None, filename=None, - defaultfname = state['currentproject'] + '_parts') + defaultfname = state['project'] + '_parts') if temp.exportpath: fullpath = temp.exportpath temp.Destroy() @@ -402,7 +402,7 @@ temp.Destroy() return fdlg = wxFileDialog(self, "Choose a file", fullpath, - ''.join([state['currentproject'], + ''.join([state['project'], '_properties', '.xls']), '*.xls', wxSAVE) @@ -498,7 +498,7 @@ self.showItem(itemobj) def OnShowProjectFrame(self, event): - self.ShowProjectFrame(state['currentproject']) + self.ShowProjectFrame(state['project']) def ShowProjectFrame(self, project): if self.projectframe: @@ -538,7 +538,7 @@ self.itemeditform.Show(True) if state['loggedin']: - self.itemeditform.sb.SetServer(state['currentserver']) + self.itemeditform.sb.SetServer(state['server']) else: self.itemeditform.sb.ClearServer() @@ -560,7 +560,7 @@ def OnNewPartsList(self): print "PSMTool.OnNewPartsList" - print "currentproject", state['currentproject'] + print " - project:", state['project'] foo = PartsListTreeFrame(self.Parent, self.dm) foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -568,7 +568,7 @@ def OnNewDoc(self): - print "PSMTool.OnNewDoc", state['currentproject'] + print "PSMTool.OnNewDoc: ", state['project'] foo = DocumentTreeFrame(self.Parent, self.dm) foo.SetMode(doctreeframe.NEW_MODE) foo.CentreOnParent() @@ -662,7 +662,6 @@ objlist = objectlist if len(objlist) > 0: - self.dm.setCurrentProject(state['currentproject']) retval = self.dm.commit(objlist) # change the grid background colour to the default colour @@ -711,20 +710,26 @@ return else: - print "looking for children" - # self.dm.setCurrentProject(state['currentproject']) + print "psmtool.PSMTool: looking for children" treetuple = self.tree.GetPyData(node) + print ' - treetuple:', treetuple obj = self.dm.getLookupObject(treetuple[1]) + # print ' - obj:', obj + linkedobjs = [] if state['loggedin']: + print ' - state: loggedin' linkedobjs = self.dm.getNAUOByAssemblyID([obj.pgef_oid]) + print ' - linkedobjs:', linkedobjs - linkedobjs = self.dm.getLocalAcusByAssemblyID( + else: + print ' - state: not loggedin' + linkedobjs = self.dm.getLocalAcusByAssemblyID( obj.pgef_oid, - self.dm.CurrentProject) + state['project']) + print ' - linkedobjs:', linkedobjs if len(linkedobjs) == 0: self.tree.SetItemHasChildren(node, False) return - self.tree.LoadTreefromObjects(self.dm, obj, node) @@ -883,21 +888,19 @@ selection = wgt.GetStringSelection() ndx = wgt.GetSelection() # if selection == 'Select a Project': - # if state.get('currentproject', 'None'): - # project = state['currentproject'] - # print 'currentproject = ', project + # if state.get('project', 'None'): + # project = state['project'] + # print 'project = ', project # wgt.SetSelection(wgt.FindString(project)) - # self.dm.setCurrentProject(project) # ndx = wgt.GetSelection() # if ndx > 0: self.changeProject(selection) - def changeProject(self, projectname): + def changeProject(self, projectid): print "PSMTool.changeProject" - print "project", projectname - state['currentproject'] = projectname - self.dm.setCurrentProject(projectname) + print "project", projectid + state['project'] = projectid wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, False) dlg = None @@ -916,7 +919,7 @@ wxALIGN_CENTRE) dlg.CentreOnParent() dlg.Show(True) - self.dm.getItemsByProject([projectname]) + self.dm.getItemsByProject([projectid]) if dlg: dlg.Destroy() self.SecureMenu() @@ -926,10 +929,10 @@ self.itemgrid.ClearGrid() self.modelgrid.ClearGrid() self.tree.DeleteAllItems() - projectname = self.topWindow.toppanel.GetProjectWidget( + projectid = self.topWindow.toppanel.GetProjectWidget( ).GetStringSelection() - numitems = self.FillGridFromProject(projectname) - self.FillItemWidgetFromProject(projectname) + numitems = self.FillGridFromProject(projectid) + self.FillItemWidgetFromProject(projectid) if numitems > 0: wgt = self.Parent.menuBar.FindMenuItem('File', 'Export') self.Parent.menuBar.Enable(wgt, True) @@ -940,7 +943,7 @@ def UpdateWindows(self): if self.projectframe: - self.projectframe.Setup(state['currentproject']) + self.projectframe.Setup(state['project']) if self.itemeditform: self.itemeditform.OnClose() if self.SearchFrame: @@ -969,10 +972,10 @@ wgt.AutoSizeColumns(True) - def FillGridFromProject(self, projectname): - print "PSMTool.FillGridFromProject", projectname + def FillGridFromProject(self, projectid): + print "PSMTool.FillGridFromProject", projectid localproducts = self.dm.getLocalObjectsOfTypes(["Part", "Model"], - projectname) + projectid) products = localproducts.values() uncommitted_oids = self.dm.getUncommittedOids() plist = [] @@ -991,9 +994,9 @@ return len(products) - def FillItemWidgetFromProject(self, projectname): + def FillItemWidgetFromProject(self, projectid): print "PSMTool.FillItemWidgetFromProject" - localitems = self.dm.getLocalObjectsOfTypes(["Model"], projectname) + localitems = self.dm.getLocalObjectsOfTypes(["Model"], projectid) localparts = localitems.values() itemlist = [] for item in localparts: @@ -1049,11 +1052,11 @@ for pkey, proj in projects.items(): wgt.Append(proj.id) wgt.Enable(True) - if state['currentproject']: - ndx = wgt.FindString(state['currentproject']) + if state['project']: + ndx = wgt.FindString(state['project']) if ndx <> wxNOT_FOUND: - wgt.SetSelection(wgt.FindString(state['currentproject'])) - wgt.SetStringSelection(state['currentproject']) + wgt.SetSelection(wgt.FindString(state['project'])) + wgt.SetStringSelection(state['project']) else: wgt.SetSelection(0) @@ -1084,8 +1087,8 @@ self.Parent.menuBar.Enable(wgt, False) wgt = self.topWindow.toppanel.GetProjectWidget() ndx = wgt.GetSelection() - projectname = wgt.GetStringSelection() - self.changeProject(projectname) + projectid = wgt.GetStringSelection() + self.changeProject(projectid) def BuildTree(self, itemid): Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.151 PanGalactic/pangalactic/utils/datamanager.py:1.152 --- PanGalactic/pangalactic/utils/datamanager.py:1.151 Thu Aug 26 18:38:30 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Fri Aug 27 01:42:05 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.151 2004/08/26 22:38:30 waterbug Exp $ +# $Id: datamanager.py,v 1.152 2004/08/27 05:42:05 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.151 $ +@version: $Revision: 1.152 $ """ -__version__ = "$Revision: 1.151 $"[11:-2] +__version__ = "$Revision: 1.152 $"[11:-2] import time import mx.DateTime @@ -43,7 +43,7 @@ """ Manager of all data transactions for PanGalaxian. """ - def __init__(self, watchdog=None, projectid=None, _registry=None, + def __init__(self, watchdog=None, _registry=None, clearcache=False, domains='PanGalactic'): """ Initialize a DataManager instance. @@ -71,12 +71,10 @@ self.domains = domains # TODO: SecurityManager is cruft -- needs complete rewrite! self.watchdog = watchdog or SecurityManager( - Person(id=state['currentuserid'])) + Person(id=state['userid'])) self.user = self.watchdog.user self.server = None self.refresh = False - print """Calling DataManager.setCurrentProject('%s')""" % projectid - self.setCurrentProject(projectid) self.projects = {} self.nauoIDs = {} self.partsListIDs = {} @@ -90,7 +88,7 @@ def getServerHost(self): - return state['currentserver'].split(':')[0] + return state['server'].split(':')[0] def setServerHost(self): raise ValueError, 'serverHost is not settable' @@ -102,7 +100,7 @@ delServerHost, 'serverHost') def getServerPort(self): - return state['currentserver'].split(':')[1] + return state['server'].split(':')[1] def setServerPort(self): raise ValueError, 'serverPort is not settable' @@ -226,9 +224,9 @@ "PartsList"]: klass = self._registry.pgef_classes[classname] obj = klass(id="NEW", - id_context=self.CurrentProject.id_context, - project=state['currentproject']) - obj.initObject(self.CurrentProject.id, self.user.id) + id_context=state['id_context'], + project=state['project']) + obj.initObject(state['project'], self.user.id) return obj @@ -255,7 +253,7 @@ user_file_name = os.path.basename(filename)) else: return None - obj.initObject(self.CurrentProject.id, self.user.id) + obj.initObject(state['project'], self.user.id) obj.setLocalFilename(filename) return obj @@ -271,7 +269,7 @@ except xmlrpclib.ProtocolError, e: print "Exception: datamanager.login", e return False - self.watchdog.user = Person(id=state['currentuserid']) + self.watchdog.user = Person(id=state['userid']) print "NOTE: create tmp role - GDA. Remove RSN" tmp_roles = [] @@ -467,28 +465,6 @@ return self.projects - def setCurrentProject(self, projectname): - """ - Set the current project, which will be used for all new objects - that have a 'project' attribute. - """ - print "DM.setCurrentProject", projectname - self.CurrentProject = None - allprojects = self.localDB.getDict(self.localDB.PROJECT) - for k, p in allprojects.items(): - if p.id == projectname: - self.CurrentProject = p - if self.CurrentProject: - print "Aha. Project '%s'" % self.CurrentProject.id - else: - print "Rats! Blank Project. Faking it." - # might as well make it the official "null" project ... - self.CurrentProject = Project(pgef_oid='NoProject', - id='NoProject', - name='Ni', - description='No project specified') - - def getLookupObject(self, pgef_oid): # print "datamanager.getLookupObject", pgef_oid return self.localDB.getLookupObject(pgef_oid) @@ -499,8 +475,8 @@ return obj - def getLocalAcus(self, currentproject = None): - return self.localDB.GetLocalAcus(currentproject) + def getLocalAcus(self, project=None): + return self.localDB.GetLocalAcus(project) def getAcuByComponent(self, obj, project = None): @@ -511,8 +487,8 @@ # build the list of objects to send back to the server for linkup project_objs = [] allprojlist = self.localDB.GetProjectObjects() - if allprojlist.has_key(self.CurrentProject.id): - projects = allprojlist[self.CurrentProject.id] + if allprojlist.has_key(state['project']): + projects = allprojlist[state['project']] for poid in projects: obj = self.localDB.getLookupObject(poid) project_objs.append(obj) @@ -556,7 +532,7 @@ updatedacuobjs = self.localDB.save(nauoobjs) # print "updatedacuobjs", updatedacuobjs # add the nauos to the projectobject dictionary in localdb - self.localDB.addProjectObjects(self.CurrentProject.id, nauoobjs) + self.localDB.addProjectObjects(state['project'], nauoobjs) if len(itemobjs) > 0: self.localDB.save(itemobjs) break # only do the first one for now @@ -583,24 +559,22 @@ return self.localDB.getDict(self.localDB.PART) - def getLocalPartsLists(self): - return self.localDB.GetPartsLists() + def getLocalObjectsOfTypes(self, classnamelist, project=None): + return self.localDB.getLocalObjectsOfTypes(classnamelist, project) - def getLocalObjectsOfTypes(self, classnamelist, currentproject = None): - return self.localDB.getLocalObjectsOfTypes(classnamelist, currentproject) - - def getLocalModels(self, currentproject = None): - return self.localDB.getLocalModels(currentproject) def getGeneralDocuments(self): return self.localDB.GetGeneralDocuments() + def getDocPartLinks(self): return self.localDB.getDict(self.localDB.DOCPTREL) + def getPartDocLinksByProjectId(self, project_id): return self.localDB.GetLocalPartDocLinks(project_id) + def getPartDocLinksByPartId(self, idlist): """Retrieves all of the DocPtRels associated with a Part ID""" # print "datamanager.getpartdoclinkbypartid" @@ -706,8 +680,8 @@ return False allprojectobjs = self.localDB.GetProjectObjects() - if allprojectobjs.has_key(self.CurrentProject.id): - projectobjs = allprojectobjs[self.CurrentProject.id] + if allprojectobjs.has_key(state['project']): + projectobjs = allprojectobjs[state['project']] if len(self.localDB.GetUncommittedObjects(projectobjs)) > 0: return True else: @@ -772,7 +746,7 @@ self.nauoIDs[acu_parent.component] = newdict self.localDB.add([acu_to_add]) - self.localDB.addProjectObjects(self.CurrentProject.id, [acu_to_add]) + self.localDB.addProjectObjects(state['project'], [acu_to_add]) def addProjectObjects(self, projname, objlist): @@ -952,7 +926,6 @@ # we should get back a list of updated objects # print "updated objects are passed back at the end of the list" objs_to_hookup = self.localDB.getCommittedObjects().values() - objs_to_hookup.append(self.CurrentProject) retval = self.server.addObjects(addlist, objs_to_hookup) if retval: Index: PanGalactic/pangalactic/client/modules/psm/docform.py diff -u PanGalactic/pangalactic/client/modules/psm/docform.py:1.11 PanGalactic/pangalactic/client/modules/psm/docform.py:1.12 --- PanGalactic/pangalactic/client/modules/psm/docform.py:1.11 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/docform.py Fri Aug 27 01:42:03 2004 @@ -168,16 +168,16 @@ self.ClearForm() self.Enable(True) ctrl = self.GetAuthorWgt() - ctrl.SetValue(state['currentuserid']) + ctrl.SetValue(state['userid']) ctrl = self.GetVersionWgt() ctrl.SetValue("1") wgt = self.GetIdentifierWgt() self.NextDocId = str(int(self.NextDocId) + 1) - if not state['currentproject']: + if not state['project']: wgt.SetValue("DOC-" + self.NextDocId) else: - wgt.SetValue(''.join([state['currentproject'], + wgt.SetValue(''.join([state['project'], "-DOC-", self.NextDocId])) prefs["nextdocid"] = self.NextDocId Index: PanGalactic/pangalactic/client/modules/psm/pgefedittree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.46 PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.47 --- PanGalactic/pangalactic/client/modules/psm/pgefedittree.py:1.46 Tue Aug 17 11:47:56 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgefedittree.py Fri Aug 27 01:42:03 2004 @@ -109,7 +109,7 @@ if rootobj: dm.getNAUOByAssemblyID([rootobj.pgef_oid]) - localacus = dm.getLocalAcus(dm.CurrentProject) + localacus = dm.getLocalAcus(state['project']) for acuid, acuobj in localacus.items(): if (acuobj.assembly == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE): Index: PanGalactic/pangalactic/client/modules/psm/partslistform.py diff -u PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.41 PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.42 --- PanGalactic/pangalactic/client/modules/psm/partslistform.py:1.41 Wed Aug 25 03:57:02 2004 +++ PanGalactic/pangalactic/client/modules/psm/partslistform.py Fri Aug 27 01:42:03 2004 @@ -1,6 +1,6 @@ -# $Id: partslistform.py,v 1.41 2004/08/25 07:57:02 waterbug Exp $ +# $Id: partslistform.py,v 1.42 2004/08/27 05:42:03 waterbug Exp $ -__version__ = "$Revision: 1.41 $"[11:-2] +__version__ = "$Revision: 1.42 $"[11:-2] from wxPython.wx import wxPanel, wxTAB_TRAVERSAL, wxPyTypeCast, wxPyDefaultPosition, wxPyDefaultSize from wxPython.wx import wxFileDialog @@ -147,7 +147,7 @@ self.Enable(True) wgt = self.GetTextctrlPoc() - wgt.SetValue(state['currentuserid']) + wgt.SetValue(state['userid']) wgt.Enable(False) wgt.SetEditable(False) wgt = self.GetTextctrlListversion() @@ -155,10 +155,10 @@ wgt = self.GetTextctrlPartslistid() #bryan self.NextDocId = str(int(self.NextDocId) + 1) - if not state['currentproject']: + if not state['project']: wgt.SetValue("PL-" + self.NextDocId) else: - wgt.SetValue(state['currentproject'] + "-PL-" + self.NextDocId) + wgt.SetValue(state['project'] + "-PL-" + self.NextDocId) wgt.SetFocus() prefs['nextplid'] = self.NextDocId writePrefs() Index: PanGalactic/pangalactic/client/modules/psm/pgeftree.py diff -u PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.42 PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.43 --- PanGalactic/pangalactic/client/modules/psm/pgeftree.py:1.42 Thu Aug 26 18:38:29 2004 +++ PanGalactic/pangalactic/client/modules/psm/pgeftree.py Fri Aug 27 01:42:03 2004 @@ -1,10 +1,10 @@ -# $Id: pgeftree.py,v 1.42 2004/08/26 22:38:29 waterbug Exp $ +# $Id: pgeftree.py,v 1.43 2004/08/27 05:42:03 waterbug Exp $ """ Base class for PanGalaxian's trees -@version: $Revision: 1.42 $ +@version: $Revision: 1.43 $ """ -__version__ = "$Revision: 1.42 $"[11:-2] +__version__ = "$Revision: 1.43 $"[11:-2] import cPickle, types @@ -21,7 +21,7 @@ from pangalactic.client.modules.psm import itemdroptarget from pangalactic.client.io import treereport -__version__ = "$Revision: 1.42 $"[11:-2] +__version__ = "$Revision: 1.43 $"[11:-2] class PgefTree(wxTreeCtrl): @@ -152,7 +152,7 @@ print " - getting more acus from server ..." dm.getNAUOByAssemblyID([rootobj.pgef_oid]) - localacus = dm.getLocalAcus(state['currentproject']) + localacus = dm.getLocalAcus(state['project']) for acuid, acuobj in localacus.items(): if acuobj.assembly == rootobj.pgef_oid and acuobj.state <> objectstatus.DELETE: AcuIds.append(acuid) Index: PanGalactic/pangalactic/client/modules/psm/partform.py diff -u PanGalactic/pangalactic/client/modules/psm/partform.py:1.15 PanGalactic/pangalactic/client/modules/psm/partform.py:1.16 --- PanGalactic/pangalactic/client/modules/psm/partform.py:1.15 Fri Aug 20 02:11:25 2004 +++ PanGalactic/pangalactic/client/modules/psm/partform.py Fri Aug 27 01:42:03 2004 @@ -131,7 +131,7 @@ self.clearForm() self.Enable(True) self.CreatingPart = True - self.GetPoc().SetValue(state['currentuserid']) + self.GetPoc().SetValue(state['userid']) self.GetPoc().SetEditable(False) self.GetCloseWgt().Enable(False) self.GetSaveWgt().Enable(True) From waterbug at ned.gsfc.nasa.gov Fri Aug 27 15:12:23 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Fri Aug 27 15:12:25 2004 Subject: [Pangalactic-commits] Move _default_display_map into OntoClass. Message-ID: <200408271912.i7RJCNYL021438@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/ontoclass.py 1.4 1.5 PanGalactic/pangalactic/utils/datamanager.py 1.152 1.153 PanGalactic/pangalactic/utils/localdb.py 1.110 1.111 Log message: Move _default_display_map into OntoClass. Index: PanGalactic/pangalactic/meta/ontoclass.py diff -u PanGalactic/pangalactic/meta/ontoclass.py:1.4 PanGalactic/pangalactic/meta/ontoclass.py:1.5 --- PanGalactic/pangalactic/meta/ontoclass.py:1.4 Sat Aug 21 13:27:30 2004 +++ PanGalactic/pangalactic/meta/ontoclass.py Fri Aug 27 15:12:21 2004 @@ -1,4 +1,4 @@ -# $Id: ontoclass.py,v 1.4 2004/08/21 17:27:30 waterbug Exp $ +# $Id: ontoclass.py,v 1.5 2004/08/27 19:12:21 waterbug Exp $ """ An OntoClass specifies the persistable attribute information structure of a @@ -13,9 +13,9 @@ they are 'datatype properties') or instances of Classes (in which case they are 'object properties'). -@version: $Revision: 1.4 $ +@version: $Revision: 1.5 $ """ -__version__ = "$Revision: 1.4 $"[11:-2] +__version__ = "$Revision: 1.5 $"[11:-2] from pangalactic.utils import utils @@ -183,6 +183,12 @@ self.localproperties = [self[pid] for pid in localpropertyids] + ################################################################## + # Python property definitions + ################################################################## + + # _default_display_order + def getDefaultDisplayOrder(self): ddo = [p.id for p in filter(lambda x: bool(getattr(x, 'default_display')), self.properties)] @@ -200,6 +206,8 @@ '_default_display_order') + # _default_display_names + def getDefaultDisplayNames(self): ddn = [(p.id, getattr(p, 'display_name', None) or p.name) for p in filter(lambda x: getattr(x, 'default_display'), @@ -218,6 +226,8 @@ '_default_display_names') + # _default_display_types + def getDefaultDisplayTypes(self): ddt = [(p.id, getattr(p, 'pgef_datatype', 'str')) for p in filter(lambda x: getattr(x, 'default_display'), @@ -234,4 +244,39 @@ setDefaultDisplayTypes, deleteDefaultDisplayTypes, '_default_display_types') + + + # _default_display_map + + def getDefaultDisplayMap(self, default_names, default_order, default_types): + """ + Generate a grid map from the combination of a + display_order list, a display_names mapping, and a + display_types mapping. + """ + display_order = [] + display_names = {} + display_types = {} + + if default_names: + display_names = default_names.copy() + if default_order: + display_order = copy.copy(default_order) + if default_types: + display_types = default_types.copy() + + return [[x, display_names.get(x, x), display_types.get(x, "string")] + for x in display_order] + + def setDefaultDisplayMap(self, value): + raise TypeError, 'Attribute cannot be set' + + def deleteDefaultDisplayMap(self): + raise TypeError, 'Attribute cannot be deleted.' + + _default_display_map = property(getDefaultDisplayMap, + setDefaultDisplayMap, + deleteDefaultDisplayMap, + '_default_display_map') + Index: PanGalactic/pangalactic/utils/datamanager.py diff -u PanGalactic/pangalactic/utils/datamanager.py:1.152 PanGalactic/pangalactic/utils/datamanager.py:1.153 --- PanGalactic/pangalactic/utils/datamanager.py:1.152 Fri Aug 27 01:42:05 2004 +++ PanGalactic/pangalactic/utils/datamanager.py Fri Aug 27 15:12:22 2004 @@ -1,12 +1,12 @@ -# $Id: datamanager.py,v 1.152 2004/08/27 05:42:05 waterbug Exp $ +# $Id: datamanager.py,v 1.153 2004/08/27 19:12:22 waterbug Exp $ """ Manager of all data transactions for PanGalaxian. -@version: $Revision: 1.152 $ +@version: $Revision: 1.153 $ """ -__version__ = "$Revision: 1.152 $"[11:-2] +__version__ = "$Revision: 1.153 $"[11:-2] import time import mx.DateTime @@ -676,7 +676,7 @@ def uncommittedData(self): # print "datamanager.uncommitteddata" - if not self.CurrentProject: + if not state['project']: return False allprojectobjs = self.localDB.GetProjectObjects() Index: PanGalactic/pangalactic/utils/localdb.py diff -u PanGalactic/pangalactic/utils/localdb.py:1.110 PanGalactic/pangalactic/utils/localdb.py:1.111 --- PanGalactic/pangalactic/utils/localdb.py:1.110 Fri Aug 27 01:42:05 2004 +++ PanGalactic/pangalactic/utils/localdb.py Fri Aug 27 15:12:22 2004 @@ -24,8 +24,6 @@ from ZODB import * -##false = None -##true = not None AddNauo = not None DeleteNauo = None @@ -39,8 +37,8 @@ class LocalStorage: - - ACUDICT = "Acu" + + ACU = "Acu" DCU = "Dcu" CATEGORY = "OntoClass" DISPLAY_CONFIG = "DisplayConfig" @@ -68,13 +66,13 @@ WFEVENTAUDIT = "WfEventAudit" WFPROCESSINSTANCE = "WfProcessInstance" WFTRANSITION = "WfTransition" - + # tuple fields: # first field - the dict name # second field - does this dict persist after clearing localdb? # third field - who sees the dict displayed in the dbbrowser? - dictlist = [(ACUDICT, 1, user), + dictlist = [(ACU, 1, user), (CATEGORY, 0, user), (DISPLAY_CONFIG, 1, admin), (DCU, 1, admin), @@ -99,7 +97,7 @@ DictListNames = [x for x, y, z in dictlist] - CommittedDicts = [ACUDICT, + CommittedDicts = [ACU, DCU, DOCUMENT, MODEL, @@ -142,7 +140,7 @@ """ self.db.pack() self.Commit() - + def Clear(self): for dict, clear_flag, config in self.dictlist: if clear_flag: @@ -155,10 +153,10 @@ del self.dbroot[dict] self.Setup() self.Commit() - + def Commit(self): get_transaction().commit() - + def Setup(self): for dict, flag, config in self.dictlist: if self.dbroot.has_key(dict): @@ -179,7 +177,7 @@ # print "localdb.saveuser" if user: self.saveDict(self.USER, user) - + def SaveRoles(self, RolesList = None): # print "localdb.saveroles" if RolesList: @@ -204,67 +202,25 @@ def savePasswd(self, pwd_id, passwd_name): pwd_dict = self.dbroot[self.PASSWD] pwd_dict[passwd_id] = passwd_name - + def getPasswd(self, passwd_id): pwd_dict = self.dbroot[self.PASSWD] return pwd_dict[passwd_id] - def getDefaultDisplayMap(self, default_names, default_order, default_types): - """ - Generate a grid map from the combination of a - display_order list, a display_names mapping, and a - display_types mapping. - """ - display_order = [] - display_names = {} - display_types = {} - - if default_names: - display_names = default_names.copy() - if default_order: - display_order = copy.copy(default_order) - if default_types: - display_types = default_types.copy() - - return [[x, display_names.get(x, x), display_types.get(x, "string")] for x in display_order] - - + ######### TODO: define OntoClass instances for the Wf classes!! def defaultDisplayConfig(self): #print "localdb.defaultdisplayconfig" current_config = {} for ocid in self._registry.onto_classes: oc = self._registry.onto_classes[ocid] - current_config[ocid] = self.getDefaultDisplayMap( - oc._default_display_names, - oc._default_display_order, - oc._default_display_types) - -######### TODO: define OntoClass instances for the Wf classes!! -# -# current_config["WfActivity"] = \ -# self.getDefaultDisplayMap(WfActivity._default_display_names, -# WfActivity._default_display_order, -# WfActivity._default_display_types) -# current_config["WfProcessInstance"] = \ -# self.getDefaultDisplayMap(WfProcessInstance._default_display_names, -# WfProcessInstance._default_display_order, -# WfProcessInstance._default_display_types) -# current_config["WfEventAudit"] = \ -# self.getDefaultDisplayMap(WfEventAudit._default_display_names, -# WfEventAudit._default_display_order, -# WfEventAudit._default_display_types) -# current_config["WfTransition"] = \ -# self.getDefaultDisplayMap(WfTransition._default_display_names, -# WfTransition._default_display_order, -# WfTransition._default_display_types) -# print "cfg keys", current_config.keys() + current_config[ocid] = oc._default_display_map self.setDisplayConfig(current_config) # print "default config done" return current_config - - + + def getDisplayConfig(self): # print "localdb.getdisplayconfig" foo = self.getDict(self.DISPLAY_CONFIG) @@ -288,20 +244,20 @@ print "localdb.updateacu is deprecated." return acu_obj - + def SavePartsList(self, partslist_list): for obj in partslist_list: self.saveItWithLookup(self.PARTSLIST, obj, True) self.Commit() - + def AddDocumentIDandTypeToUncommittedList(self, idtypelist): for docid, doctype in idtypelist: self.dbroot[self.UNCOMMITTEDDOCUMENTIDS][docid] = doctype self.Commit() - + def GetACUDict(self): - return self.dbroot[self.ACUDICT] + return self.dbroot[self.ACU] def GetLocalAcus(self, project=None): @@ -347,7 +303,7 @@ def GetNauoByComponentID(self, component, project = None): #print "localdb.getnauobycomponentid" return self.GetAcuByComponent(component, project) - + def GetAcuByComponent(self, component, project = None): #print "localdb.getacubycomponentid" @@ -417,7 +373,7 @@ tmpobj = self.getLookupObject(nobj.pgef_oid) elif tmpobj.state == None: tmpobj = self.getLookupObject(nobj.pgef_oid) - + if tmpobj: if hasattr(tmpobj, "project"): if project and tmpobj.project == project: @@ -470,14 +426,14 @@ #print "objdict", objdict.keys() return objdict - - + + def lookupOid(self, oid): """ Looks up the oid in the oidLookup dictionary to see in what dictionary a particular object was placed. This is mainly to help speedup the retrieval of an object from the local cache. - + @type oid: string @param oid: internal id of an object @return dictname: the name of the internal dictionary where the @@ -489,8 +445,8 @@ except KeyError: pass return dictname - - + + def GetGeneralDocuments(self): # so far, the only documents with specialized editors are Alerts and Parts Lists. # Thus we only ignore these types. @@ -510,8 +466,8 @@ tmpdict[docid] = doc #print "# documents", len(tmpdict) return tmpdict - - + + def GetPartsLists(self): tmpdict = {} for docid, doc in self.dbroot[self.DOCUMENT].items(): @@ -523,7 +479,7 @@ if doc.state <> objectstatus.DELETE: tmpdict[docid] = doc return tmpdict - + def ClearUncommittedObjects(self, committedobjs): #print "localdb.clearuncommittedobjects", committedobjs @@ -543,8 +499,8 @@ def GetUncommittedDict(self): uncommittedobjs = self.dbroot[self.UNCOMMITTEDOBJECTS] return uncommittedobjs - - + + def GetUncommittedObjects(self, projectobjs): #print "localdb.getuncommittedobjects" try: @@ -559,7 +515,7 @@ except: print "no uncommitted objects; returning empty list" return [] - + def getLocalObject(self, searchdict, pgef_oid): #print "localdb.getlocalobject", searchdict, pgef_oid @@ -572,14 +528,14 @@ retobj = None return retobj - + def GetUncommittedItemIDs(self): return self.dbroot[self.UNCOMMITTEDITEMIDS] def GetUncommittedDocumentIDs(self): return self.dbroot[self.UNCOMMITTEDDOCUMENTIDS] - + def GetUncommittedPartsListIDs(self): return self.dbroot[self.UNCOMMITTEDPARTSLISTIDS] @@ -596,7 +552,7 @@ allobjects[currproject] = objdict self.SetProjectObjects(allobjects) # print "allobjects", allobjects - + def GetProjectObjects(self): #print "localdb.getprojectobjecs" projects = self.dbroot[self.PROJECTOBJECTS] @@ -610,7 +566,7 @@ pass self.dbroot[self.PROJECTOBJECTS] = objects self.Commit() - + def getCommittedObjects(self): #print "localdb.getCommittedObjects" objdict = {} @@ -621,7 +577,7 @@ if objs: objdict.update(objs) return objdict - + def GetObject(self, searchdict, id): try: @@ -640,7 +596,7 @@ for obj in objlist: self.dbroot[dictname][obj.pgef_oid] = obj - + def saveObject(self, savedict, id, obj): #print "localdb.saveobject", savedict, id try: @@ -651,7 +607,7 @@ # print e # import traceback # traceback.print_exc() - + def AppendUncommittedData(self, uncommitteddict, unsavedlist): @@ -659,11 +615,11 @@ tmplist.extend(unsavedlist) self.dbroot[uncommitteddict] = tmplist self.Commit() - + def SaveUncommittedData(self, uncommitteddict, unsavedlist): self.dbroot[uncommitteddict] = unsavedlist self.Commit() - + def SetProjects(self, objects): self.dbroot[self.PROJECT] = objects @@ -696,9 +652,9 @@ self.SaveWfProcessInstance([obj]) else: self.SaveWfProcessInstance([obj]) - + elif classname == "Acu": - self.saveItWithLookup(self.ACUDICT, obj, override) + self.saveItWithLookup(self.ACU, obj, override) retlist.append(obj) elif classname == "Person": @@ -711,11 +667,11 @@ retlist.append(obj) else: print "NOTE:", classname, "is not in localdb.dictlist" - + self.Commit() return retlist - + def saveItNoLookup(self, dictname, obj, override): #print "saveitnolookup" if self.dbroot[dictname].has_key(obj.pgef_oid): @@ -751,16 +707,16 @@ self.saveObjectWithLookup(self.UNCOMMITTEDOBJECTS, unsavedlist) self.Commit() - + def RemoveACU(self, acuobj): if acuobj.__class__.__name__ == "Acu": - if self.dbroot[self.ACUDICT].has_key(acuobj.pgef_oid): - del self.dbroot[self.ACUDICT][acuobj.pgef_oid] + if self.dbroot[self.ACU].has_key(acuobj.pgef_oid): + del self.dbroot[self.ACU][acuobj.pgef_oid] elif isinstance(acuobj, types.StringType): - if self.dbroot[self.ACUDICT].has_key(acuobj): - del self.dbroot[self.ACUDICT][acuobj] + if self.dbroot[self.ACU].has_key(acuobj): + del self.dbroot[self.ACU][acuobj] self.Commit() - + def getUncommittedWfObjects(self): try: @@ -769,7 +725,7 @@ wfobj_types = ["WfProcessInstance", "WfActivity", "WfEventAudit"] - + for objid, obj in uncommittedobjs.items(): if obj.__class__.__name__ in wfobj_types: objlist.append(obj) @@ -832,7 +788,7 @@ #print "objdict", objdict return objdict - + def SaveWfProcessInstance(self, wflist, recurse = False): #print "localdb.SaveWfProcessInstance" for wfobj in wflist: @@ -895,7 +851,7 @@ else: #print "make dict", context self.dbroot[self.CATEGORY][context] = ZODB.Persistence.PersistentMapping() - + #print "dict", self.CATEGORY, context, len(values) tmpdict = ZODB.Persistence.PersistentMapping() for obj in values: @@ -930,7 +886,7 @@ return tmpdict else: return self.dbroot[self.PGEFFILE] - + def evalAttrExp(self, left, op, right): #print " eval", left, op, right From waterbug at ned.gsfc.nasa.gov Sun Aug 29 03:17:56 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Sun Aug 29 03:17:59 2004 Subject: [Pangalactic-commits] Add an OntoClass instance for 'Ontology' to the registry, Message-ID: <200408290717.i7T7Hujc027998@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/registry.py 1.2 1.3 Log message: Add an OntoClass instance for 'Ontology' to the registry, and sort the registry report in order of registered OntoClass instance dependencies. Index: PanGalactic/pangalactic/meta/registry.py diff -u PanGalactic/pangalactic/meta/registry.py:1.2 PanGalactic/pangalactic/meta/registry.py:1.3 --- PanGalactic/pangalactic/meta/registry.py:1.2 Sat Aug 21 13:27:30 2004 +++ PanGalactic/pangalactic/meta/registry.py Sun Aug 29 03:17:55 2004 @@ -1,9 +1,9 @@ -# $Id: registry.py,v 1.2 2004/08/21 17:27:30 waterbug Exp $ +# $Id: registry.py,v 1.3 2004/08/29 07:17:55 waterbug Exp $ """ Pan Galactic Engineering Framework Registry -@version: $Revision: 1.2 $ +@version: $Revision: 1.3 $ The PanGalacticRegistry maintains information about the pangalactic.enterprise classes and custom OntoClasses that is used by the @@ -16,7 +16,7 @@ lower-case. """ -__version__ = "$Revision: 1.2 $"[11:-2] +__version__ = "$Revision: 1.3 $"[11:-2] import imp import re @@ -64,8 +64,29 @@ ocinst = self.pgef_classes[c]._schema ocid = ocinst.id self.onto_classes[ocid] = ocinst + # add an OntoClass instance whose id is 'Ontology' + oprops = [] + for a in Ontology._schema: + p = OntoProperty() + for pp in OntoProperty._schema: + setattr(p, pp, + Ontology._schema[a].get(pp, + utils.getDefault(OntoProperty._schema[pp])) + ) + p.id = a + oprops.append(p) + ooc = OntoClass( + id='Ontology', + id_context='PanGalactic', + name='Property', + abbrev='o', + base=self.onto_classes['VersionedObject'], + description=Ontology.__doc__, + properties=oprops + ) + self.onto_classes['Ontology'] = ooc # add an OntoClass instance whose id is 'OntoClass' - # (i.e., the OntoClass's OntoClass ... ;) + # (i.e., OntoClass's OntoClass ... ;) ocprops = [] for a in OntoClass._schema: p = OntoProperty() @@ -108,7 +129,6 @@ ) self.onto_classes['OntoProperty'] = opoc - ## This section of code that implemented 'refs' and ## 'deps_order' is not needed any more ... but I'm keeping it ## just in case ... @@ -121,10 +141,8 @@ # print 'Looking at attribute', a # if self.pgef_classes[cn]._schema[a].pgef_datatype in self.pgef_classes: # self.refs[cn][a] = self.pgef_classes[cn]._schema[a].pgef_datatype - # ## build self.deps_order (for now, this only includes - # ## Python classes, not OntoClasses) - # ## TODO: implement handling for inheritance and dependencies - # ## among OntoClasses. + # ## build self.deps_order (order of dependencies of Python + # ## classes) # self.deps_order = [] # todo = self.pgef_classes.copy() # todocns = todo.keys()[:] @@ -147,6 +165,60 @@ # # print self.deps_order # break + + ################################################### + # Python property: '_ontodeps' + ################################################### + + def getOntoDeps(self): + """ + Compute a list of the id's of currently registered OntoClass + instances in dependency order. + """ + # The OntoClass instance(s) with a null 'base' attribute is(are) + # considered the root(s). Single inheritance among OntoClass + # instances is also assumed (for now). + ontodeps = [] + todo = self.onto_classes.copy() + todoocids = todo.keys()[:] + for ocid in todoocids: + if not self.onto_classes[ocid].base: + ontodeps.append(ocid) + del todo[ocid] + # print 'Independent OntoClass instances: ' + # print ontodeps + while 1: + depocids = ontodeps[:] + todoocids = todo.keys()[:] + for ocid in todoocids: + if self.onto_classes[ocid].base.id in depocids: + ontodeps.append(ocid) + del todo[ocid] + # In English: either todo is empty or none of the 'bases' of + # the OntoClass instances in todo are registered (i.e., are in + # self.onto_classes), so the loop must be terminated. (The + # latter condition should never happen, but Murphy says it + # will ... ;) + if (not todo or + (not (Set([x.base.id for x in todo.values()]) & + Set([x.id for x in self.onto_classes.values()])))): + # print 'OntoClass instance dependency order:' + # print ontodeps + return ontodeps + + + def setOntoDeps(self, value): + raise TypeError, 'Attribute cannot be set' + + def deleteOntoDeps(): + raise TypeError, 'Attribute cannot be deleted.' + + _ontodeps = property(getOntoDeps, + setOntoDeps, + deleteOntoDeps, + '_ontodeps') + + def _importModule(self, name): """ Find the module in sys.path and import it. @@ -246,7 +318,8 @@ """ Generate a plain text report on the registry's contents. """ - print '\nPGEF REGISTRY REPORT\n====================' + print '\n====================' + print 'PGEF REGISTRY REPORT\n====================' print '--------------------------------------------------' # print " - glimpseservers:" # g = self.glimpseservers.keys() @@ -258,9 +331,7 @@ # else: # print " - None." # print '--------------------------------------------------' - ocids = self.onto_classes.keys() - ocids.sort() - for ocid in ocids: + for ocid in self._ontodeps: oc = self.onto_classes[ocid] print '\nOntoClass ID .............. %s' % ocid print ' Base OntoClass ID ....... %s' % getattr(oc.base, 'id', 'None') From waterbug at ned.gsfc.nasa.gov Mon Aug 30 02:25:13 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Mon Aug 30 02:25:15 2004 Subject: [Pangalactic-commits] Progress: reads rdfs:Class and owl:Class stmts. Message-ID: <200408300625.i7U6PDu7009461@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/importers/owlreader.py 1.2 1.3 Log message: Progress: reads rdfs:Class and owl:Class stmts. Index: PanGalactic/pangalactic/importers/owlreader.py diff -u PanGalactic/pangalactic/importers/owlreader.py:1.2 PanGalactic/pangalactic/importers/owlreader.py:1.3 --- PanGalactic/pangalactic/importers/owlreader.py:1.2 Sat Aug 21 13:27:30 2004 +++ PanGalactic/pangalactic/importers/owlreader.py Mon Aug 30 02:25:11 2004 @@ -1,12 +1,12 @@ -# $Id: owlreader.py,v 1.2 2004/08/21 17:27:30 waterbug Exp $ +# $Id: owlreader.py,v 1.3 2004/08/30 06:25:11 waterbug Exp $ """ Reader for OWL (Web Ontology Language) -@version: $Revision: 1.2 $ +@version: $Revision: 1.3 $ """ -__version__ = "$Revision: 1.2 $"[11:-2] +__version__ = "$Revision: 1.3 $"[11:-2] # PanGalactic imports from pangalactic.meta.ontology import Ontology @@ -23,16 +23,50 @@ def __init__(self): self._parser = RDF.Parser() - def import(self, path): - """ - Import a set of OntoClasses and OntoProperties from an OWL - file. For now, just do - - * rdf:Property - * rdfs:Class - * owl:Class - * owl:DatatypeProperty - * owl:ObjectProperty - """ - m = RDF.Model() - # self._parser.parse_into_model(m, f) + def readRdf(self, uri_string): + """ + Import a set of OntoClasses and OntoProperties from an OWL + file. For now, just do + + * rdf:Property + * rdfs:Class + * owl:Class + * owl:DatatypeProperty + * owl:ObjectProperty + """ + m = RDF.Model() + uri = RDF.Uri(uri_string) + self._parser.parse_into_model(m, uri) + # for s in m: + # print s + qs1 = RDF.Statement( + subject=None, + predicate=RDF.Node( + uri_string="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + object=RDF.Node( + uri_string="http://www.w3.org/2000/01/rdf-schema#Class")) + print "RDFS Classes found:" + res = m.find_statements(qs1) + i = 0 + for stmt in res: + print stmt + i += 1 + if not i: + print ' - none -' + + qs2 = RDF.Statement( + subject=None, + predicate=RDF.Node( + uri_string="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + object=RDF.Node( + uri_string="http://www.w3.org/2002/07/owl#Class")) + print "OWL Classes found:" + res = m.find_statements(qs2) + i = 0 + for stmt in res: + print stmt + i += 1 + if not i: + print ' - none -' + + From waterbug at ned.gsfc.nasa.gov Tue Aug 31 02:24:56 2004 From: waterbug at ned.gsfc.nasa.gov (waterbug CVS) Date: Tue Aug 31 02:24:58 2004 Subject: [Pangalactic-commits] Some constants. Message-ID: <200408310624.i7V6OuKR029640@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/importers/owlreader.py 1.3 1.4 Log message: Some constants. Index: PanGalactic/pangalactic/importers/owlreader.py diff -u PanGalactic/pangalactic/importers/owlreader.py:1.3 PanGalactic/pangalactic/importers/owlreader.py:1.4 --- PanGalactic/pangalactic/importers/owlreader.py:1.3 Mon Aug 30 02:25:11 2004 +++ PanGalactic/pangalactic/importers/owlreader.py Tue Aug 31 02:24:55 2004 @@ -1,12 +1,12 @@ -# $Id: owlreader.py,v 1.3 2004/08/30 06:25:11 waterbug Exp $ +# $Id: owlreader.py,v 1.4 2004/08/31 06:24:55 waterbug Exp $ """ Reader for OWL (Web Ontology Language) -@version: $Revision: 1.3 $ +@version: $Revision: 1.4 $ """ -__version__ = "$Revision: 1.3 $"[11:-2] +__version__ = "$Revision: 1.4 $"[11:-2] # PanGalactic imports from pangalactic.meta.ontology import Ontology @@ -16,6 +16,26 @@ # import Redland RDF API import RDF +# For now, OwlReader only understands: +# * rdf:Property +# * rdf:Type +# * rdfs:Class +# * owl:Class +# * owl:DatatypeProperty +# * owl:ObjectProperty + +# Constants +RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +RDFS_NS = "http://www.w3.org/2000/01/rdf-schema#" +OWL_NS = "http://www.w3.org/2002/07/owl#" +RDF_PROPERTY = RDF_NS + "Property" +RDF_TYPE = RDF_NS + "type" +RDFS_CLASS = RDFS_NS + "Class" +OWL_CLASS = OWL_NS + "Class" +OWL_DATATYPEPROPERTY = OWL_NS + "DatatypeProperty" +OWL_OBJECTPROPERTY = OWL_NS + "ObjectProperty" + + class OwlReader: """ Reader for OWL (Web Ontology Language) @@ -26,13 +46,7 @@ def readRdf(self, uri_string): """ Import a set of OntoClasses and OntoProperties from an OWL - file. For now, just do - - * rdf:Property - * rdfs:Class - * owl:Class - * owl:DatatypeProperty - * owl:ObjectProperty + file. """ m = RDF.Model() uri = RDF.Uri(uri_string) @@ -42,14 +56,14 @@ qs1 = RDF.Statement( subject=None, predicate=RDF.Node( - uri_string="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + uri_string=RDF_TYPE), object=RDF.Node( - uri_string="http://www.w3.org/2000/01/rdf-schema#Class")) + uri_string=RDFS_CLASS)) print "RDFS Classes found:" res = m.find_statements(qs1) i = 0 for stmt in res: - print stmt + print stmt.subject.uri i += 1 if not i: print ' - none -' @@ -57,14 +71,14 @@ qs2 = RDF.Statement( subject=None, predicate=RDF.Node( - uri_string="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + uri_string=RDF_TYPE), object=RDF.Node( - uri_string="http://www.w3.org/2002/07/owl#Class")) + uri_string=OWL_CLASS)) print "OWL Classes found:" res = m.find_statements(qs2) i = 0 for stmt in res: - print stmt + print stmt.subject.uri i += 1 if not i: print ' - none -'