Andrew Wold

Forum Replies Created

Viewing 2 replies – 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: Accessing original message in chained xlate #83757
    Andrew Wold
    Participant

      Thanks, yeah I ended up writing something similar but in java instead. I’ll put my code below since I don’t see much java in these forums.

      Here is the setter. I return a new Vector() but I don’t actually need any return value.

      Code:

      public class SetKeyValuePair extends XLTStrings {
         @Override
         public Vector xlateStrings(CloverEnv cloverEnv, Xpm xpm, Vector vector) throws CloverleafException {
             PropertyTree userData = xpm.metadata.getUserdata();

             if(vector.size() == 2 ) {
                 userData.put((String)vector.elementAt(0), (String) vector.elementAt(1));
                 xpm.metadata.setUserdata(userData);
             }

             return new Vector();
         }
      }

      This is the getter.

      Code:

      public class GetKeyValuePair extends XLTString {
         @Override
         public Object xlateString(CloverEnv cloverEnv, Xpm xpm, String inVal) throws CloverleafException {
             PropertyTree userData = xpm.metadata.getUserdata();

             return userData.getString(inVal);
         }
      }

      in reply to: Accessing original message in chained xlate #83754
      Andrew Wold
      Participant

        Thanks for that tip Russ, that will help me out in the future. Unfortunately I couldn’t find the data I was looking for in the meta data and I think I’ll need to follow a different route to get the data like Jim had mentioned.

      Viewing 2 replies – 1 through 2 (of 2 total)