/*
contractCustom.java
This file is a management class for automounter map objects in Ganymede.
Created: 15 March 1999
Module By: Jonathan Abbey, jonabbey@arlut.utexas.edu
-----------------------------------------------------------------------
Ganymede Directory Management System
Copyright (C) 1996-2013
The University of Texas at Austin
Ganymede is a registered trademark of The University of Texas at Austin
Contact information
Author Email: ganymede_author@arlut.utexas.edu
Email mailing list: ganymede@arlut.utexas.edu
US Mail:
Computer Science Division
Applied Research Laboratories
The University of Texas at Austin
PO Box 8029, Austin TX 78713-8029
Telephone: (512) 835-3200
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package arlut.csd.ganymede.gasharl;
import arlut.csd.ganymede.common.Invid;
import arlut.csd.ganymede.common.SchemaConstants;
import arlut.csd.ganymede.server.DBEditObject;
import arlut.csd.ganymede.server.DBEditSet;
import arlut.csd.ganymede.server.DBObject;
import arlut.csd.ganymede.server.DBObjectBase;
/*------------------------------------------------------------------------------
class
contractCustom
------------------------------------------------------------------------------*/
public class contractCustom extends DBEditObject implements SchemaConstants {
/**
* Customization Constructor
*/
public contractCustom(DBObjectBase objectBase)
{
super(objectBase);
}
/**
* Create new object constructor
*/
public contractCustom(DBObjectBase objectBase, Invid invid, DBEditSet editset)
{
super(objectBase, invid, editset);
}
/**
* Check-out constructor, used by DBObject.createShadow()
* to pull out an object for editing.
*/
public contractCustom(DBObject original, DBEditSet editset)
{
super(original, editset);
}
/**
* <p>This method is used to control whether or not it is acceptable to
* make a link to the given field in this
* {@link arlut.csd.ganymede.server.DBObject DBObject} type when the
* user only has editing access for the source
* {@link arlut.csd.ganymede.server.InvidDBField InvidDBField} and not
* the target.</p>
*
* <p>See {@link arlut.csd.ganymede.server.DBEditObject#anonymousLinkOK(arlut.csd.ganymede.server.DBObject,short,
* arlut.csd.ganymede.server.DBObject,short,arlut.csd.ganymede.server.GanymedeSession)
* anonymousLinkOK(obj,short,obj,short,GanymedeSession)} for details on
* anonymousLinkOK() method chaining.</p>
*
* <p>Note that the {@link
* arlut.csd.ganymede.server.DBEditObject#choiceListHasExceptions(arlut.csd.ganymede.server.DBField)
* choiceListHasExceptions()} method will call this version of anonymousLinkOK()
* with a null targetObject, to determine that the client should not
* use its cache for an InvidDBField's choices. Any overriding done
* of this method must be able to handle a null targetObject, or else
* an exception will be thrown inappropriately.</p>
*
* <p>The only reason to consult targetObject in any case is to
* allow or disallow anonymous object linking to a field based on
* the current state of the target object. If you are just writing
* generic anonymous linking rules for a field in this object type,
* targetObject won't concern you anyway. If you do care about the
* targetObject's state, though, you have to be prepared to handle
* a null valued targetObject.</p>
*
* <p><b>*PSEUDOSTATIC*</b></p>
*
* @param targetObject The object that the link is to be created in (may be null)
* @param targetFieldID The field that the link is to be created in
*/
public boolean anonymousLinkOK(DBObject object, short fieldID)
{
// we want anyone to be able to link a group to this contract
if (fieldID == contractSchema.CONTRACTGROUPS)
{
return true;
}
return super.anonymousLinkOK(object, fieldID);
}
}