@Test public void setParamsTest() { Date date = new Date(); dynamicScreen.setScreenId("test").setName("name").setChapter1("chapter1").setUpdate(date).setParams(); assertEquals(4, buffer.getVolatileParams().size()); assertEquals(0, buffer.getPersistentParams().size()); assertEquals(1, buffer.getVolatileParams().get("pid").getValues().size()); assertEquals("test", buffer.getVolatileParams().get("pid").getValues().get(0).execute()); assertEquals(1, buffer.getVolatileParams().get("pchap").getValues().size()); assertEquals("chapter1", buffer.getVolatileParams().get("pchap").getValues().get(0).execute()); assertEquals(1, buffer.getVolatileParams().get("pidt").getValues().size()); assertEquals(new SimpleDateFormat("yyyyMMddHHmm", Locale.getDefault()).format(date), buffer.getVolatileParams().get("pidt").getValues().get(0).execute()); assertEquals(1, buffer.getVolatileParams().get("p").getValues().size()); assertEquals("name", buffer.getVolatileParams().get("p").getValues().get(0).execute()); }
@Override void setParams() { super.setParams(); if (screenId.length() > 255) { screenId = ""; Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "screenId too long, replaced by empty value"); } String value = chapter1; if (value == null) { value = chapter2; } else { value += (chapter2 == null) ? "" : ("::" + chapter2); } if (value == null) { value = chapter3; } else { value += (chapter3 == null) ? "" : ("::" + chapter3); } tracker.setParam(Hit.HitParam.DynamicScreenId.stringValue(), screenId) .setParam(Hit.HitParam.DynamicScreenValue.stringValue(), value, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.DynamicScreenDate.stringValue(), new SimpleDateFormat(UPDATE_FORMAT, Locale.ENGLISH).format(update)) .setParam(Hit.HitParam.Screen.stringValue(), name, new ParamOption().setRelativePosition(ParamOption.RelativePosition.after) .setRelativeParameterKey(Hit.HitParam.UserId.stringValue()) .setEncode(true)); }
DynamicScreen extends AbstractScreen { @Override void setParams() { super.setParams(); if (screenId.length() > 255) { screenId = ""; Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "screenId too long, replaced by empty value"); } String value = chapter1; if (value == null) { value = chapter2; } else { value += (chapter2 == null) ? "" : ("::" + chapter2); } if (value == null) { value = chapter3; } else { value += (chapter3 == null) ? "" : ("::" + chapter3); } tracker.setParam(Hit.HitParam.DynamicScreenId.stringValue(), screenId) .setParam(Hit.HitParam.DynamicScreenValue.stringValue(), value, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.DynamicScreenDate.stringValue(), new SimpleDateFormat(UPDATE_FORMAT, Locale.ENGLISH).format(update)) .setParam(Hit.HitParam.Screen.stringValue(), name, new ParamOption().setRelativePosition(ParamOption.RelativePosition.after) .setRelativeParameterKey(Hit.HitParam.UserId.stringValue()) .setEncode(true)); } }
DynamicScreen extends AbstractScreen { @Override void setParams() { super.setParams(); if (screenId.length() > 255) { screenId = ""; Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "screenId too long, replaced by empty value"); } String value = chapter1; if (value == null) { value = chapter2; } else { value += (chapter2 == null) ? "" : ("::" + chapter2); } if (value == null) { value = chapter3; } else { value += (chapter3 == null) ? "" : ("::" + chapter3); } tracker.setParam(Hit.HitParam.DynamicScreenId.stringValue(), screenId) .setParam(Hit.HitParam.DynamicScreenValue.stringValue(), value, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.DynamicScreenDate.stringValue(), new SimpleDateFormat(UPDATE_FORMAT, Locale.ENGLISH).format(update)) .setParam(Hit.HitParam.Screen.stringValue(), name, new ParamOption().setRelativePosition(ParamOption.RelativePosition.after) .setRelativeParameterKey(Hit.HitParam.UserId.stringValue()) .setEncode(true)); } DynamicScreen(Tracker tracker); }
DynamicScreen extends AbstractScreen { @Override void setParams() { super.setParams(); if (screenId.length() > 255) { screenId = ""; Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "screenId too long, replaced by empty value"); } String value = chapter1; if (value == null) { value = chapter2; } else { value += (chapter2 == null) ? "" : ("::" + chapter2); } if (value == null) { value = chapter3; } else { value += (chapter3 == null) ? "" : ("::" + chapter3); } tracker.setParam(Hit.HitParam.DynamicScreenId.stringValue(), screenId) .setParam(Hit.HitParam.DynamicScreenValue.stringValue(), value, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.DynamicScreenDate.stringValue(), new SimpleDateFormat(UPDATE_FORMAT, Locale.ENGLISH).format(update)) .setParam(Hit.HitParam.Screen.stringValue(), name, new ParamOption().setRelativePosition(ParamOption.RelativePosition.after) .setRelativeParameterKey(Hit.HitParam.UserId.stringValue()) .setEncode(true)); } DynamicScreen(Tracker tracker); String getScreenId(); Date getUpdate(); @Deprecated DynamicScreen setScreenId(int screenId); DynamicScreen setScreenId(String screenId); DynamicScreen setChapter1(String chapter1); DynamicScreen setChapter2(String chapter2); DynamicScreen setChapter3(String chapter3); DynamicScreen setUpdate(Date update); DynamicScreen setName(String name); DynamicScreen setAction(Action action); DynamicScreen setLevel2(int level2); DynamicScreen setLevel2(String level2); DynamicScreen setIsBasketScreen(boolean isBasketScreen); }
DynamicScreen extends AbstractScreen { @Override void setParams() { super.setParams(); if (screenId.length() > 255) { screenId = ""; Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "screenId too long, replaced by empty value"); } String value = chapter1; if (value == null) { value = chapter2; } else { value += (chapter2 == null) ? "" : ("::" + chapter2); } if (value == null) { value = chapter3; } else { value += (chapter3 == null) ? "" : ("::" + chapter3); } tracker.setParam(Hit.HitParam.DynamicScreenId.stringValue(), screenId) .setParam(Hit.HitParam.DynamicScreenValue.stringValue(), value, new ParamOption().setEncode(true)) .setParam(Hit.HitParam.DynamicScreenDate.stringValue(), new SimpleDateFormat(UPDATE_FORMAT, Locale.ENGLISH).format(update)) .setParam(Hit.HitParam.Screen.stringValue(), name, new ParamOption().setRelativePosition(ParamOption.RelativePosition.after) .setRelativeParameterKey(Hit.HitParam.UserId.stringValue()) .setEncode(true)); } DynamicScreen(Tracker tracker); String getScreenId(); Date getUpdate(); @Deprecated DynamicScreen setScreenId(int screenId); DynamicScreen setScreenId(String screenId); DynamicScreen setChapter1(String chapter1); DynamicScreen setChapter2(String chapter2); DynamicScreen setChapter3(String chapter3); DynamicScreen setUpdate(Date update); DynamicScreen setName(String name); DynamicScreen setAction(Action action); DynamicScreen setLevel2(int level2); DynamicScreen setLevel2(String level2); DynamicScreen setIsBasketScreen(boolean isBasketScreen);  }