本文整理汇总了Java中com.mendix.systemwideinterfaces.core.IMendixObject.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java IMendixObject.setValue方法的具体用法?Java IMendixObject.setValue怎么用?Java IMendixObject.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mendix.systemwideinterfaces.core.IMendixObject
的用法示例。
在下文中一共展示了IMendixObject.setValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateModule
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
protected Object validateModule(IContext context, String moduleName) throws CoreException {
this.activeModule.add(moduleName);
if (!this.moduleMap.containsKey(moduleName)) {
this.moduleMap.put(moduleName, null);
IMendixObject obj = Core.instantiate(context, Module.getType());
obj.setValue(context, Module.MemberNames.ModuleName.toString(), moduleName);
if (this.allNewModules) {
this.moduleMap.put(moduleName, obj);
obj.setValue(context, Module.MemberNames.SynchronizeObjectsWithinModule.toString(), true);
}
Core.commit(context, obj);
}
return this.moduleMap.get(moduleName);
}
示例2: copyAttributes
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static void copyAttributes(IContext context, IMendixObject source, IMendixObject target)
{
if (source == null)
throw new IllegalStateException("source is null");
if (target == null)
throw new IllegalStateException("target is null");
for(IMetaPrimitive e : target.getMetaObject().getMetaPrimitives()) {
if (!source.hasMember(e.getName()))
continue;
if (e.isVirtual() || e.getType() == PrimitiveType.AutoNumber)
continue;
target.setValue(context, e.getName(), source.getValue(context, e.getName()));
}
}
示例3: cloneObject
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static Boolean cloneObject(IContext c, IMendixObject source,
IMendixObject target, Boolean withAssociations)
{
Map<String, ? extends IMendixObjectMember<?>> members = source.getMembers(c);
for(String key : members.keySet()) {
IMendixObjectMember<?> m = members.get(key);
if (m.isVirtual())
continue;
if (m instanceof MendixAutoNumber)
continue;
if (withAssociations || ((!(m instanceof MendixObjectReference) && !(m instanceof MendixObjectReferenceSet)&& !(m instanceof MendixAutoNumber))))
target.setValue(c, key, m.getValue(c));
}
return true;
}
示例4: getTypeId
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的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();
}
示例5: getIdentifiableLanguages
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static List<IMendixObject> getIdentifiableLanguages(IContext context, String username, String password) throws MendixException {
LOGGER.debug("Executing IdentifiableLanagues Connector...");
service.setUsernameAndPassword(username, password);
List<IdentifiableLanguage> identifieableLanguages;
try{
identifieableLanguages = service.getIdentifiableLanguages().execute();
} catch (Exception e) {
LOGGER.error("Watson Service Connection - Failed retrieving the identifiable languages", e);
throw new MendixException(e);
}
final List<IMendixObject> results = new ArrayList<IMendixObject>();
for(IdentifiableLanguage language : identifieableLanguages){
IMendixObject result = Core.instantiate(context, watsonservices.proxies.Language.entityName);
result.setValue(context, "Name", language.getName());
result.setValue(context, "Code", language.getLanguage());
results.add(result);
}
return results;
}
示例6: createMessageResponse
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
private static IMendixObject createMessageResponse(IContext context, ConversationContext conversationContext, MessageResponse response) throws CoreException {
updateConversationContext(context, conversationContext, response);
final IMendixObject messageResponseObject = Core.instantiate(context, ConversationMessageResponse.entityName);
messageResponseObject.setValue(context, ConversationMessageResponse.MemberNames.ConversationId.toString(), response.getContext().get("conversation_id"));
messageResponseObject.setValue(context, ConversationMessageResponse.MemberNames.Input.toString(), response.getInputText());
messageResponseObject.setValue(context, ConversationMessageResponse.MemberNames.Output.toString(), response.getTextConcatenated(","));
Core.commit(context, messageResponseObject);
for(Intent intent : response.getIntents()){
final IMendixObject intentObject = Core.instantiate(context, ConversationIntent.entityName);
intentObject.setValue(context, ConversationIntent.MemberNames.Name.toString(), intent.getIntent());
intentObject.setValue(context, ConversationIntent.MemberNames.Confidence.toString(), intent.getConfidence().toString());
intentObject.setValue(context, ConversationIntent.MemberNames.ConversationIntent_ConversationResponse.toString(), messageResponseObject.getId());
Core.commit(context, intentObject);
}
for(Entity entity : response.getEntities()){
final IMendixObject entityObject = Core.instantiate(context, ConversationEntity.entityName);
entityObject.setValue(context, ConversationEntity.MemberNames.Name.toString(), entity.getEntity());
entityObject.setValue(context, ConversationEntity.MemberNames.Value.toString(), entity.getValue());
entityObject.setValue(context, ConversationEntity.MemberNames.ConversationEntity_ConversationResponse.toString(), messageResponseObject.getId());
Core.commit(context, entityObject);
}
return messageResponseObject;
}
示例7: processMember
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public void processMember(IContext context, IMendixObject curObject, Map<String, IMendixObject> membersByName, List<IMendixObject> memberList, IMetaPrimitive metaPrimitive, String name) throws CoreException {
IMendixObject curMember;
IDataType memberType = Core.createDataType(metaPrimitive.getType().toString());
if( !membersByName.containsKey(name) )
{
curMember = Core.instantiate(context, MxObjectMember.getType());
curMember.setValue(context, MxObjectMember.MemberNames.AttributeName.toString(), name);
curMember.setValue(context, MxObjectMember.MemberNames.AttributeType.toString(), metaPrimitive.getType().toString());
curMember.setValue(context, MxObjectMember.MemberNames.AttributeTypeEnum.toString(),
this.builder.getPrimitiveTypesFromPrimitiveType(metaPrimitive.getType()) != null ? this.builder.getPrimitiveTypesFromPrimitiveType(metaPrimitive.getType()).toString() : null);
curMember.setValue(context, MxObjectMember.MemberNames.MxObjectMember_MxObjectType.toString(), curObject.getId());
curMember.setValue(context, MxObjectMember.MemberNames.MxObjectMember_Type.toString(), this.builder.getTypeId(context, memberType));
curMember.setValue(context, MxObjectMember.MemberNames.FieldLength.toString(), metaPrimitive.getLength());
curMember.setValue(context, MxObjectMember.MemberNames.IsVirtual.toString(), metaPrimitive.isVirtual());
memberList.add(curMember);
}
else
{
curMember = membersByName.get(name);
if(MxObjectEnum.getType().equals(curMember.getType()))
{
Core.delete(context, curMember);
curMember = Core.instantiate(context, MxObjectMember.getType());
curMember.setValue(context, MxObjectMember.MemberNames.AttributeName.toString(), name);
curMember.setValue(context, MxObjectMember.MemberNames.MxObjectMember_MxObjectType.toString(), curObject.getId());
}
curMember.setValue(context, MxObjectMember.MemberNames.MxObjectMember_Type.toString(), this.builder.getTypeId(context, memberType));
curMember.setValue(context, MxObjectMember.MemberNames.AttributeType.toString(), metaPrimitive.getType().toString());
curMember.setValue(context, MxObjectMember.MemberNames.AttributeTypeEnum.toString(),
this.builder.getPrimitiveTypesFromPrimitiveType(metaPrimitive.getType()) != null ? this.builder.getPrimitiveTypesFromPrimitiveType(metaPrimitive.getType()).toString() : null);
curMember.setValue(context, MxObjectMember.MemberNames.FieldLength.toString(), metaPrimitive.getLength());
curMember.setValue(context, MxObjectMember.MemberNames.IsVirtual.toString(), metaPrimitive.isVirtual());
memberList.add(curMember);
membersByName.remove(name);
}
}
示例8: constructInstance
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
/**
* Creates one instance of the type of this XPath query, and initializes the provided attributes to the provided values.
* @param keysAndValues AttributeName, AttributeValue, AttributeName2, AttributeValue2... list.
* @return
* @throws CoreException
*/
public T constructInstance(boolean autoCommit, Object... keysAndValues) throws CoreException
{
assertEven(keysAndValues);
IMendixObject newObj = Core.instantiate(context, this.entity);
for(int i = 0; i < keysAndValues.length; i+= 2)
newObj.setValue(context, String.valueOf(keysAndValues[i]), toMemberValue(keysAndValues[i + 1]));
if (autoCommit)
Core.commit(context, newObj);
return createProxy(context, proxyClass, newObj);
}
示例9: encryptMemberIfChanged
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static boolean encryptMemberIfChanged(IContext context, IMendixObject item,
String member, String key) throws Exception
{
if (memberHasChanged(context, item, member)) {
if (item.getMetaObject().getMetaPrimitive(member).getType() != PrimitiveType.String)
throw new IllegalArgumentException("The member '" + member + "' is not a string attribute!");
item.setValue(context, member, StringUtils.encryptString(key, (String) item.getValue(context, member)));
return true;
}
return false;
}
示例10: buildToneCategory
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
private static void buildToneCategory(IContext context, final IMendixObject toneAnalyzerResponse,
ToneCategory toneCategory)
{
final IMendixObject toneCategoryObject = Core.instantiate(context, watsonservices.proxies.ToneCategory.entityName);
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.CategoryId.toString(), toneCategory.getId());
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.Name.toString(), toneCategory.getName());
toneCategory.getTones().forEach(toneScore -> buildTone(context, toneCategoryObject, toneScore));
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.Tone_Categories.toString(), toneAnalyzerResponse.getId());
}
示例11: buildTone
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
private static void buildTone(IContext context, final IMendixObject toneCategoryObject, ToneScore toneScore)
{
final IMendixObject toneObject = Core.instantiate(context, Tone.entityName);
toneObject.setValue(context, Tone.MemberNames.ToneId.toString(), toneScore.getId());
toneObject.setValue(context, Tone.MemberNames.Name.toString(), toneScore.getName());
toneObject.setValue(context, Tone.MemberNames.Score.toString(), toneScore.getScore().toString());
toneObject.setValue(context, Tone.MemberNames.Tones.toString(), toneCategoryObject.getId());
}
示例12: buildSentenceTone
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
private static void buildSentenceTone(IContext context, final IMendixObject toneAnalyzerResponse,
SentenceTone sentenceTone)
{
final IMendixObject sentenceToneObject = Core.instantiate(context, watsonservices.proxies.SentenceTone.entityName);
sentenceToneObject.setValue(context, watsonservices.proxies.SentenceTone.MemberNames.SentenceId.toString(), sentenceTone.getId());
sentenceToneObject.setValue(context, watsonservices.proxies.SentenceTone.MemberNames.InputFrom.toString(), sentenceTone.getInputFrom());
sentenceToneObject.setValue(context, watsonservices.proxies.SentenceTone.MemberNames.InputTo.toString(), sentenceTone.getInputTo());
sentenceToneObject.setValue(context, watsonservices.proxies.SentenceTone.MemberNames.Text.toString(), sentenceTone.getText());
sentenceTone.getTones().forEach(toneCategory -> buildToneCategoryPerSentence(context, sentenceToneObject, toneCategory));
sentenceToneObject.setValue(context, watsonservices.proxies.SentenceTone.MemberNames.Sentence_Tones.toString(), toneAnalyzerResponse.getId());
}
示例13: buildToneCategoryPerSentence
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
private static void buildToneCategoryPerSentence(IContext context, final IMendixObject sentenceToneObject,
ToneCategory toneCategory) {
final IMendixObject toneCategoryObject = Core.instantiate(context, watsonservices.proxies.ToneCategory.entityName);
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.CategoryId.toString(), toneCategory.getId());
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.Name.toString(), toneCategory.getName());
for(ToneScore toneScore : toneCategory.getTones()){
buildTone(context, toneCategoryObject, toneScore);
}
toneCategoryObject.setValue(context, watsonservices.proxies.ToneCategory.MemberNames.Sentence_Tone_Categories.toString(), sentenceToneObject.getId());
}
示例14: detectFaces
import com.mendix.systemwideinterfaces.core.IMendixObject; //导入方法依赖的package包/类
public static List<IMendixObject> detectFaces(IContext context, Image image, String apikey) throws MendixException {
LOGGER.debug("Executing DetectFaces Connector...");
service.setApiKey(apikey);
final File imageToDetectFaces = createImageFile(context, image);
final VisualRecognitionOptions options = new VisualRecognitionOptions.Builder().
images(imageToDetectFaces).
build();
DetectedFaces response;
try {
response = service.detectFaces(options).execute();
} catch (Exception e) {
LOGGER.error("Watson Service connection - Failed detecting the faces in the image: " + imageToDetectFaces.getName(), e);
throw new MendixException(e);
}
finally{
imageToDetectFaces.delete();
}
final List<IMendixObject> results = new ArrayList<IMendixObject>();
for (ImageFace imageFace : response.getImages()) {
if(imageFace.getError() != null){
LOGGER.warn("Error processing the image "+ imageFace.getImage() + ": " + imageFace.getError().getDescription());
continue;
}
for(Face face :imageFace.getFaces()){
IMendixObject faceObject = Core.instantiate(context, watsonservices.proxies.Face.entityName);
if(face.getAge() != null){
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.AgeMax.toString(), face.getAge().getMax());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.AgeMin.toString(), face.getAge().getMin());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.AgeScore.toString(), face.getAge().getScore().toString());
}
if(face.getGender() != null){
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.GenderName.toString(), face.getGender().getGender());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.GenderScore.toString(), face.getGender().getScore().toString());
}
if(face.getLocation() != null){
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.LocationHeight.toString(), face.getLocation().getHeight());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.LocationLeft.toString(), face.getLocation().getLeft());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.LocationTop.toString(), face.getLocation().getTop());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.LocationWidth.toString(), face.getLocation().getWidth());
}
if(face.getIdentity() != null){
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.IdentityName.toString(), face.getIdentity().getName());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.IdentityScore.toString(), face.getIdentity().getScore().toString());
faceObject.setValue(context, watsonservices.proxies.Face.MemberNames.TypeHierarchy.toString(), face.getIdentity().getTypeHierarchy());
}
results.add(faceObject);
}
}
return results;
}