本文整理汇总了Java中com.mendix.systemwideinterfaces.core.IMendixIdentifier类的典型用法代码示例。如果您正苦于以下问题:Java IMendixIdentifier类的具体用法?Java IMendixIdentifier怎么用?Java IMendixIdentifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMendixIdentifier类属于com.mendix.systemwideinterfaces.core包,在下文中一共展示了IMendixIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeId
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
protected IMendixIdentifier getTypeId(IContext context, IDataType dataType) throws CoreException {
String valueTypeName = dataType.getDSLType();
if (dataType.getType() == DataTypeEnum.Enumeration)
valueTypeName = "Enum";
else if (dataType.isList())
valueTypeName = "List of type: " + dataType.getObjectType();
else if (dataType.isMendixObject())
valueTypeName = "Object of type: " + dataType.getObjectType();
List<IMendixObject> result = Core.retrieveXPathQuery(context, "//" + ValueType.getType() + "[" + ValueType.MemberNames.Name + "='" + valueTypeName + "']");
if (result.size() > 0)
return result.get(0).getId();
IMendixObject memberTypeObject = Core.instantiate(context, ValueType.getType());
memberTypeObject.setValue(context, ValueType.MemberNames.Name.toString(), valueTypeName);
memberTypeObject.setValue(context, ValueType.MemberNames.ValueType_MxObjectType.toString(), this.getObjectTypeId(context, dataType));
PrimitiveTypes type = getPrimitiveTypesFromDatatype(dataType);
memberTypeObject.setValue(context, ValueType.MemberNames.TypeEnum.toString(), (type == null ? null : type.toString()));
Core.commit(context, memberTypeObject);
return memberTypeObject.getId();
}
示例2: updateConversationContext
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Map<String, Object> updateConversationContext(IContext context, ConversationContext conversationContext, MessageResponse response) throws CoreException {
deleteCurrentDialogStack(conversationContext);
conversationContext.setConversationId(context, response.getContext().get("conversation_id").toString());
Map<String, Object> responseContext = response.getContext();
Map<String, Object> resposeSystemContext = (Map<String, Object>) responseContext.get("system");
conversationContext.setDialogTurnCounter(new BigDecimal(resposeSystemContext.get("dialog_turn_counter").toString()));
conversationContext.setDialogRequestCounter(new BigDecimal(resposeSystemContext.get("dialog_request_counter").toString()));
List<String> dialogStack = (List<String>) resposeSystemContext.get("dialog_stack");
for(String dialogNode : dialogStack){
final IMendixObject dialogNodeObject = Core.instantiate(context, DialogNode.entityName );
dialogNodeObject.setValue(context, DialogNode.MemberNames.Name.toString(), dialogNode);
final List<IMendixIdentifier> conversationContextList = new ArrayList<IMendixIdentifier>();
conversationContextList.add(conversationContext.getMendixObject().getId());
dialogNodeObject.setValue(context, DialogNode.MemberNames.Dialog_Stack.toString(), conversationContextList);
Core.commit(context, dialogNodeObject);
}
conversationContext.commit();
return resposeSystemContext;
}
示例3: getCloneOfObject
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
private static IMendixIdentifier getCloneOfObject(IContext ctx, IMendixObject src,
List<String> toskip, List<String> tokeep, List<String> revAssoc,
List<String> skipEntities, List<String> skipModules,
Map<IMendixIdentifier, IMendixIdentifier> mappedObjects) throws CoreException
{
String objType = src.getMetaObject().getName();
String modName = src.getMetaObject().getModuleName();
// if object is already being cloned, return ref to clone
if (mappedObjects.containsKey(src.getId())) {
return mappedObjects.get(src.getId());
// if object should be skipped based on module or entity, return source object
} else if (skipEntities.contains(objType) || skipModules.contains(modName)) {
return src.getId();
// if not already being cloned, create clone
} else {
IMendixObject clone = Core.instantiate(ctx, src.getType());
duplicate(ctx, src, clone, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
return clone.getId();
}
}
示例4: handleMxObject
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
private IMendixObject handleMxObject(IContext context, Map<String,IMendixObject> existingMetaObjects, IMetaObject metaObject) throws CoreException
{
String completeName = metaObject.getName();
IMendixObject object;
if(!existingMetaObjects.containsKey(completeName) && !this.builder.allNewModules)
{
object = Core.instantiate(context, MxObjectType.getType());
existingMetaObjects.put(completeName, object);
object.setValue(context, MxObjectType.MemberNames.CompleteName.toString(), completeName);
object.setValue(context, MxObjectType.MemberNames.Name.toString(), completeName.substring(completeName.indexOf(".")+1));
object.setValue(context, MxObjectType.MemberNames.Module.toString(), completeName.substring(0,completeName.indexOf(".")));
}
else
object = existingMetaObjects.get(completeName);
if( object != null ) {
List<IMendixIdentifier> superObjectIds = new ArrayList<IMendixIdentifier>();
for(IMetaObject superObject : metaObject.getSuperObjects()) {
IMendixObject superMxObject = this.handleMxObject(context, existingMetaObjects, superObject);
if( superMxObject != null )
superObjectIds.add(superMxObject.getId());
}
object.setValue(context, MxObjectType.MemberNames.MxObjectType_SubClassOf_MxObjectType.toString(), superObjectIds);
object.setValue(context, MxObjectType.MemberNames.PersistenceType.toString(), (metaObject.isPersistable() ? PersistenceType.Persistable.toString() : PersistenceType.Non_persistent.toString()) );
if( this.builder.moduleMap.get(metaObject.getModuleName()) != null ) {
object.setValue(context, MxObjectType.MemberNames.MxObjectType_Module.toString(), this.builder.moduleMap.get(metaObject.getModuleName()).getId());
}
Core.commit(context, object);
}
return object;
}
示例5: deepClone
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
public static void deepClone(IContext c, IMendixObject source, IMendixObject target, String membersToSkip, String membersToKeep, String reverseAssociations, String excludeEntities, String excludeModules) throws CoreException
{
List<String> toskip = Arrays.asList((membersToSkip + ",createdDate,changedDate").split(","));
List<String> tokeep = Arrays.asList((membersToKeep + ",System.owner,System.changedBy").split(","));
List<String> revAssoc = Arrays.asList(reverseAssociations.split(","));
List<String> skipEntities = Arrays.asList(excludeEntities.split(","));
List<String> skipModules = Arrays.asList(excludeModules.split(","));
Map<IMendixIdentifier, IMendixIdentifier> mappedIDs = new HashMap<IMendixIdentifier, IMendixIdentifier>();
duplicate(c, source, target, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedIDs);
}
示例6: sortIdList
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
public static void sortIdList(List<IMendixIdentifier> ids) {
Collections.sort(ids, new Comparator<IMendixIdentifier>() {
@Override
public int compare(IMendixIdentifier o1,
IMendixIdentifier o2) {
if (o2 == null && o1 == null)
return 0;
if (o2 == null)
return -1;
if (o1 == null)
return 1;
return Long.compare(o1.toLong(), o2.toLong());
}
});
}
示例7: handleMicroflowParams
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
private List<IMendixObject> handleMicroflowParams(IContext context, String microflowName, IMendixObject obj) throws CoreException
{
Map<String, IMendixObject> existingParams = new HashMap<String, IMendixObject>();
List<IMendixObject> params = Core.retrieveXPathQuery(context, "//" + Parameter.getType() + "[" + Microflows.MemberNames.Microflows_InputParameter + "='" + obj.getId().toLong() + "']");
for(IMendixObject param : params)
existingParams.put((String)param.getValue(context, Parameter.MemberNames.Name.toString()), param);
List<IMendixIdentifier> inputParameterIds = new ArrayList<IMendixIdentifier>();
List<IMendixObject> inputParameterObjs = new ArrayList<IMendixObject>();
for(Entry<String,IDataType> entry : Core.getInputParameters(microflowName).entrySet())
{
String inputParameterName = entry.getKey();
IDataType inputParameterType = entry.getValue();
IMendixObject parameter;
if(existingParams.containsKey(inputParameterName))
{
parameter = existingParams.get(inputParameterName);
existingParams.remove(inputParameterName);
}
else
parameter = Core.instantiate(context, Parameter.getType());
parameter.setValue(context, Parameter.MemberNames.Name.toString(), inputParameterName);
parameter.setValue(context, Parameter.MemberNames.Parameter_ValueType.toString(), this.builder.getTypeId(context, inputParameterType));
parameter.setValue(context, Parameter.MemberNames.Parameter_MxObjectType.toString(), this.builder.getObjectTypeId(context, inputParameterType));
inputParameterObjs.add( parameter );
inputParameterIds.add(parameter.getId());
}
obj.setValue(context, Microflows.MemberNames.Microflows_Output_Type.toString(), this.builder.getTypeId(context, Core.getReturnType(microflowName)));
obj.setValue(context, Microflows.MemberNames.Microflows_InputParameter.toString(), inputParameterIds);
this.builder.removeDeletedObjects(context, existingParams);
return inputParameterObjs;
}
示例8: getLastChangedByUser
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
public static IMendixObject getLastChangedByUser(IContext context,
IMendixObject thing) throws CoreException
{
if (thing == null || !thing.hasChangedByAttribute())
return null;
IMendixIdentifier itemId = thing.getChangedBy(context);
if (itemId == null)
return null;
return Core.retrieveId(context, itemId);
}
示例9: getCreatedByUser
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
public static IMendixObject getCreatedByUser(IContext context,
IMendixObject thing) throws CoreException
{
if (thing == null || !thing.hasOwnerAttribute())
return null;
IMendixIdentifier itemId = thing.getOwner(context);
if (itemId == null)
return null;
return Core.retrieveId(context, itemId);
}
示例10: getAccountPasswordData_Account
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* @param context
* @return value of AccountPasswordData_Account
*/
public final administration.proxies.Account getAccountPasswordData_Account(IContext context) throws CoreException
{
administration.proxies.Account result = null;
IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.AccountPasswordData_Account.toString());
if (identifier != null)
result = administration.proxies.Account.load(context, identifier);
return result;
}
示例11: getClusterManager
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* @param context
* @return value of ClusterManager
*/
public final system.proxies.XASInstance getClusterManager(IContext context) throws CoreException
{
system.proxies.XASInstance result = null;
IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.ClusterManager.toString());
if (identifier != null)
result = system.proxies.XASInstance.load(context, identifier);
return result;
}
示例12: getSession_User
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* @param context
* @return value of Session_User
*/
public final system.proxies.User getSession_User(IContext context) throws CoreException
{
system.proxies.User result = null;
IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Session_User.toString());
if (identifier != null)
result = system.proxies.User.load(context, identifier);
return result;
}
示例13: getgrantableRoles
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* @param context
* @return value of grantableRoles
*/
@SuppressWarnings("unchecked")
public final java.util.List<system.proxies.UserRole> getgrantableRoles(IContext context) throws CoreException
{
java.util.List<system.proxies.UserRole> result = new java.util.ArrayList<system.proxies.UserRole>();
Object valueObject = getMendixObject().getValue(context, MemberNames.grantableRoles.toString());
if (valueObject == null)
return result;
for (IMendixObject mendixObject : Core.retrieveIdList(context, (java.util.List<IMendixIdentifier>) valueObject))
result.add(system.proxies.UserRole.initialize(context, mendixObject));
return result;
}
示例14: setgrantableRoles
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* Set value of grantableRoles
* @param context
* @param grantableroles
*/
public final void setgrantableRoles(IContext context, java.util.List<system.proxies.UserRole> grantableroles)
{
java.util.List<IMendixIdentifier> identifiers = new java.util.ArrayList<IMendixIdentifier>();
for (system.proxies.UserRole proxyObject : grantableroles)
identifiers.add(proxyObject.getMendixObject().getId());
getMendixObject().setValue(context, MemberNames.grantableRoles.toString(), identifiers);
}
示例15: getUserRoles
import com.mendix.systemwideinterfaces.core.IMendixIdentifier; //导入依赖的package包/类
/**
* @param context
* @return value of UserRoles
*/
@SuppressWarnings("unchecked")
public final java.util.List<system.proxies.UserRole> getUserRoles(IContext context) throws CoreException
{
java.util.List<system.proxies.UserRole> result = new java.util.ArrayList<system.proxies.UserRole>();
Object valueObject = getMendixObject().getValue(context, MemberNames.UserRoles.toString());
if (valueObject == null)
return result;
for (IMendixObject mendixObject : Core.retrieveIdList(context, (java.util.List<IMendixIdentifier>) valueObject))
result.add(system.proxies.UserRole.initialize(context, mendixObject));
return result;
}