General InformationThis opening ID is invoked when:
This opening ID is used to customize the users that can access these commands and batches, and the objects that can be exported and imported.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
Sample for FBDI, CATIA File, 3DXML Authoring Import, 3DXML Authoring Export, and CAD Transition
Let UserName(String)
Let OrganisationName(String)
Let ProjectName(String)
Let RoleName(String)
Let bAccessAllowed(Boolean)
Let ImportExportFormat(String)
UserName = Parameters->GetAttributeString("UserName")
OrganisationName = Parameters->GetAttributeString("OrganisationName")
ProjectName = Parameters->GetAttributeString("ProjectName")
RoleName = Parameters->GetAttributeString("RoleName")
ImportExportFormat = Parameters->GetAttributeString("ImportExportFormat")
if ( UserName == "xxx")
{
Parameters->SetAttributeBoolean("AccessAllowed",FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed",TRUE)
}
if(ImportExportFormat == "FBDI")
{
Let ListOfFileNames(List)
Set ListOfFileNames = Parameters->GetAttributeObject("FileNames")
Let SizeOfFileNameList(Integer)
Set SizeOfFileNameList=ListOfFileNames.Size()
Trace(1,"xxx ImportExportFormat: #",ImportExportFormat)
Trace(1,"xxx SizeOfFileNameList: #",SizeOfFileNameList)
if(SizeOfFileNameList > 0)
{
Let i(Integer)
Set i=1
Let FileName(String)
for i while i <= SizeOfFileNameList
{
Set FileName = ListOfFileNames[i]
if ((UserName == "xxx") and (FileName == "D:\xxx\CATIA_DATA\19xNew\Product1.CATProduct"))
{
bAccessAllowed = FALSE
break
}
}
if (bAccessAllowed == FALSE)
{
Parameters->SetAttributeBoolean("AccessAllowed", FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed", TRUE)
}
}
}
if(ImportExportFormat == "CATIA File")
{
Let ListOfObjects(List)
Let ListOfAttributes(List)
Let ListSize(Integer)
Let ListOfListSize(Integer)
Let i(Integer)
Let TypeOfObject(String)
Let NameOfObject(String)
Let RevisionOfObject(String)
Let MaturityOfObject(String)
ListOfObjects = Parameters->GetAttributeObject("ObjectList")
ListOfListSize = ListOfObjects.Size()
Set i = 1
Trace(1,"xxx ImportExportFormat: #",ImportExportFormat)
Trace(1,"xxx ListOfListSize: #",ListOfListSize)
if (ListOfListSize > 0)
{
for i while i <= ListOfListSize
{
Set bAccessAllowed = FALSE
Set ListOfAttributes = ListOfObjects.GetItem(i)
ListSize = ListOfAttributes.Size()
if (ListSize >0)
{
NameOfObject= ListOfAttributes[1]
TypeOfObject= ListOfAttributes[2]
RevisionOfObject = ListOfAttributes[3]
MaturityOfObject = ListOfAttributes[4]
}
if ((RevisionOfObject == "A") and (UserName == "xxx"))
{
bAccessAllowed = FALSE
break
}
}
if (bAccessAllowed == FALSE)
{
Parameters->SetAttributeBoolean("AccessAllowed", FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed", TRUE)
}
}
}
if((ImportExportFormat == "3DXML Authoring Import") OR (ImportExportFormat == "3DXML Authoring Export"))
{
Let ListOfObjects(List)
Let ListOfAttributes(List)
Let ListSize(Integer)
Let ListOfListSize(Integer)
Let i(Integer)
Let TypeOfObject(String)
Let NameOfObject(String)
Let RevisionOfObject(String)
Let MaturityOfObject(String)
ListOfObjects = Parameters->GetAttributeObject("ObjectList")
ListOfListSize = ListOfObjects.Size()
Set i = 1
if (ListOfListSize > 0)
{
for i while i <= ListOfListSize
{
Set bAccessAllowed = TRUE
Set ListOfAttributes = ListOfObjects.GetItem(i)
ListSize = ListOfAttributes.Size()
if (ListSize >0)
{
NameOfObject= ListOfAttributes[1]
TypeOfObject= ListOfAttributes[2]
RevisionOfObject = ListOfAttributes[3]
MaturityOfObject = ListOfAttributes[4]
}
if ((RevisionOfObject == "A") and (UserName == "xxx"))
{
bAccessAllowed = FALSE
break
}
}
if (bAccessAllowed == FALSE)
{
Parameters->SetAttributeBoolean("AccessAllowed", FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed", TRUE)
}
}
}
If (ImportExportFormat == "3DXML Authoring Import AsRefER")
{
if (UserName == "MyUser")
{
Parameters->SetAttributeBoolean("AccessAllowed",TRUE)
}
}
If((ImportExportFormat == "CAD Transition")
{
Let ListOfObjects(List)
Let ListOfAttributes(List)
Let ListSize(Integer)
Let ListOfListSize(Integer)
Let i(Integer)
Let TypeOfObject(String)
Let NameOfObject(String)
Let RevisionOfObject(String)
Let MaturityOfObject(String)
ListOfObjects = Parameters->GetAttributeObject("ObjectList")
ListOfListSize = ListOfObjects.Size()
Set i = 1
if (ListOfListSize > 0)
{
for i while i <= ListOfListSize
{
Set bAccessAllowed = TRUE
Set ListOfAttributes = ListOfObjects.GetItem(i)
ListSize = ListOfAttributes.Size()
if (ListSize >0)
{
NameOfObject= ListOfAttributes[1]
TypeOfObject= ListOfAttributes[2]
RevisionOfObject = ListOfAttributes[3]
MaturityOfObject = ListOfAttributes[4]
}
if ((RevisionOfObject == "A") and (UserName == "ala8"))
{
bAccessAllowed = FALSE
break
}
}
if (bAccessAllowed == FALSE)
{
Parameters->SetAttributeBoolean("AccessAllowed", FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed", TRUE)
}
}
}
Sample for XPDM
Let UserName(String)
Let OrganisationName(String)
Let ProjectName(String)
Let RoleName(String)
Let bAccessAllowed(Boolean)
Let ImportExportFormat(String)
UserName = Parameters->GetAttributeString("UserName")
OrganisationName = Parameters->GetAttributeString("OrganisationName")
ProjectName = Parameters->GetAttributeString("ProjectName")
RoleName = Parameters->GetAttributeString("RoleName")
ImportExportFormat = Parameters->GetAttributeString("ImportExportFormat")
if ( UserName == "xxx")
{
Parameters->SetAttributeBoolean("AccessAllowed",FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed",TRUE)
}
If((ImportExportFormat == "XPDM Import") OR (ImportExportFormat == "XPDM Export"))
{
Let ListOfObjects(List)
Let ListOfAttributes(List)
Let ListSize(Integer)
Let ListOfListSize(Integer)
Let i(Integer)
Let TypeOfObject(String)
Let NameOfObject(String)
Let RevisionOfObject(String)
Let MaturityOfObject(String)
ListOfObjects = Parameters->GetAttributeObject("ObjectList")
ListOfListSize = ListOfObjects.Size()
Set i = 1
if (ListOfListSize > 0)
{
for i while i <= ListOfListSize
{
Set bAccessAllowed = TRUE
Set ListOfAttributes = ListOfObjects.GetItem(i)
ListSize = ListOfAttributes.Size()
if (ListSize >0)
{
NameOfObject= ListOfAttributes[1]
TypeOfObject= ListOfAttributes[2]
RevisionOfObject = ListOfAttributes[3]
MaturityOfObject = ListOfAttributes[4]
}
if ((RevisionOfObject == "A") and (UserName == "xxx"))
{
bAccessAllowed = FALSE
break
}
}
if (bAccessAllowed == FALSE)
{
Parameters->SetAttributeBoolean("AccessAllowed", FALSE)
}
else
{
Parameters->SetAttributeBoolean("AccessAllowed", TRUE)
}
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||