本文整理汇总了Java中org.apache.wicket.PageParameters类的典型用法代码示例。如果您正苦于以下问题:Java PageParameters类的具体用法?Java PageParameters怎么用?Java PageParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageParameters类属于org.apache.wicket包,在下文中一共展示了PageParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkLocation
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static boolean checkLocation(PageParameters param) {
boolean result = true;
String id = param.getString(LocationUtil.KEY_LOCATION_ID);
if (id == null || id.equals("")) {
return false;
}
try {
MplsNmsInventoryConnector conn = MplsNmsInventoryConnector.getInstance();
Set<LocationDto> dtos = conn.getActiveLocationDtos();
for (LocationDto dto : dtos) {
if (DtoUtil.getMvoId(dto).toString().equals(id)) {
return false;
}
}
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
return result;
}
示例2: LocationViewPage
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public LocationViewPage(PageParameters params) {
Logger log = getLogger();
try {
AAAWebUtil.checkAAA(this, OPERATION_NAME);
this.current = LocationUtil.getLocation(params);
this.model = new LocationNodeModel(this.current);
this.model.renew();
log.debug("current location: " + current.getName());
log.debug("param=" + params);
ListView<BreadCrumbLink> breadcrumbList = LocationUtil.createBreadCrumbList(current);
add(breadcrumbList);
createHeader();
populateLocation();
populateNode();
createAddLocationLink();
createEditLocationLink();
createDeleteLocationLink();
createAddNodeLink();
log.debug("end");
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例3: getVlanIdPool
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static VlanIdPoolDto getVlanIdPool(PageParameters param) throws InventoryException, IOException {
String poolName = param.getString(PARAM_POOL_NAME);
poolName = Util.decodeUTF8(poolName);
List<VlanIdPoolDto> pools = new ArrayList<VlanIdPoolDto>(VlanUtil.getPools());
for (VlanIdPoolDto pool : pools) {
if (poolName == null || poolName.length() == 0) {
if (Util.stringToNull(pool.getName()) == null) {
return pool;
}
} else {
if (pool.getName() != null && pool.getName().equals(poolName)) {
return pool;
}
}
}
return null;
}
示例4: getRsvpLspPathPool
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static RsvpLspHopSeriesIdPoolDto getRsvpLspPathPool(PageParameters param) throws ExternalServiceException, IOException {
String poolName = param.getString(PARAM_POOL_NAME);
poolName = Util.decodeUTF8(poolName);
List<RsvpLspHopSeriesIdPoolDto> pools = MplsNmsInventoryConnector.getInstance().getRsvpLspHopSeriesIdPool();
for (RsvpLspHopSeriesIdPoolDto pool : pools) {
if (poolName == null || poolName.length() == 0) {
if (Util.stringToNull(pool.getName()) == null) {
return pool;
}
} else {
if (pool.getName() != null && pool.getName().equals(poolName)) {
return pool;
}
}
}
return null;
}
示例5: getPseudowireIdPool
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static PseudowireLongIdPoolDto getPseudowireIdPool(PageParameters param) throws ExternalServiceException, IOException {
String poolName = param.getString(PARAM_POOL_NAME);
poolName = Util.decodeUTF8(poolName);
List<PseudowireLongIdPoolDto> pools = MplsNmsInventoryConnector.getInstance().getPseudoWireLongIdPools();
if (pools != null) {
for (PseudowireLongIdPoolDto pool : pools) {
if (poolName == null || poolName.length() == 0) {
if (Util.stringToNull(pool.getName()) == null) {
return pool;
}
} else {
if (pool.getName() != null && pool.getName().equals(poolName)) {
return pool;
}
}
}
}
return null;
}
示例6: getPseudowireStringIdPool
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static PseudowireStringIdPoolDto getPseudowireStringIdPool(PageParameters param) throws ExternalServiceException, IOException {
String poolName = param.getString(PARAM_POOL_NAME);
List<PseudowireStringIdPoolDto> pools2 = MplsNmsInventoryConnector.getInstance().getPseudoWireStringIdPools();
if (pools2 != null) {
for (PseudowireStringIdPoolDto pool : pools2) {
if (poolName == null || poolName.length() == 0) {
if (Util.stringToNull(pool.getName()) == null) {
return pool;
}
} else {
if (pool.getName() != null && pool.getName().equals(poolName)) {
return pool;
}
}
}
}
return null;
}
示例7: createNodeLink
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static Link<Void> createNodeLink(final String id, final PortDto port) {
final PageParameters param;
final String nodeName;
if (port != null) {
param = NodeUtil.getParameters(port.getNode());
nodeName = port.getNode().getName();
} else {
param = null;
nodeName = null;
}
BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, SimpleNodeDetailPage.class, param);
link.setEnabled(port != null);
Label label = new Label("nodeName", nodeName);
link.add(label);
return link;
}
示例8: onSubmit
import org.apache.wicket.PageParameters; //导入依赖的package包/类
@Override
public void onSubmit() {
PageParameters param = new PageParameters();
List<String> commands = getCommands(_fileUploadField.getFileUpload());
ShellCommands cmd = new ShellCommands(EDITOR_NAME);
cmd.addCommands(commands);
try {
ShellConnector.getInstance().execute2(cmd);
param.add(KEY_LOG, "success");
} catch (InventoryException e) {
param.put(KEY_LOG, e.getMessage());
}
setResponsePage(new DeployPage(param));
}
示例9: getSlot
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static SlotDto getSlot(PageParameters param) throws InventoryException, ExternalServiceException {
try {
String nodeName = Util.decodeUTF8(param.getString(KEY_NODE));
String slotFqn = Util.decodeUTF8(param.getString(KEY_SLOT_FQN));
InventoryConnector conn = InventoryConnector.getInstance();
NodeDto node = conn.getNodeDto(nodeName);
Set<ChassisDto> chassises = node.getChassises();
for (ChassisDto chassis : chassises) {
for (SlotDto slot : chassis.getSlots()) {
if (slot.getAbsoluteName().equals(slotFqn)) {
return slot;
}
}
}
return null;
} catch (Exception e) {
throw ExceptionUtils.getExternalServiceException(e);
}
}
示例10: getInt
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static int getInt(PageParameters param, String keyName) {
Object o = param.getAsInteger(keyName);
if (o == null) {
throw new IllegalArgumentException(keyName + " is null.");
}
if (o.getClass().isArray()) {
Object[] arr = (Object[]) o;
if (arr.length == 0) {
throw new IllegalArgumentException(keyName + " is array, but has no value.");
}
o = arr[0];
}
if (o instanceof Integer) {
return ((Integer) o).intValue();
} else if (o instanceof String) {
return Integer.parseInt((String) o);
} else {
return Integer.parseInt(o.toString());
}
}
示例11: getPvc
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static AtmPvcIfDto getPvc(PageParameters param) throws InventoryException, ExternalServiceException {
try {
String nodeName = param.getString(NodeUtil.KEY_NODE);
String atmIfName = param.getString(KEY_ATM_PORT);
if (atmIfName == null) {
throw new IllegalStateException("Invalid argument. ATM parent port not specified. " + param);
}
String vpi_ = param.getString(KEY_ATM_PVC_VPI);
if (vpi_ == null) {
throw new IllegalStateException("Invalid argument VPI not specified. " + param);
}
String vci_ = param.getString(KEY_ATM_PVC_VCI);
if (vci_ == null) {
throw new IllegalStateException("Invalid argument VCI not specified. " + param);
}
int vpi = Integer.parseInt(vpi_);
int vci = Integer.parseInt(vci_);
return getAtmPvc(nodeName, atmIfName, vpi, vci);
} catch (Exception e) {
throw ExceptionUtils.getExternalServiceException(e);
}
}
示例12: getParameters
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public static PageParameters getParameters(AtmPvcIfDto pvc) {
if (pvc == null) {
throw new IllegalArgumentException("pvc is null.");
} else if (pvc.getPhysicalPort() == null) {
throw new IllegalArgumentException("pvc is not initialized. parent is null.");
} else if (pvc.getVpi() == null) {
throw new IllegalArgumentException("pvc is not initialized. vpi is null.");
} else if (pvc.getVci() == null) {
throw new IllegalArgumentException("pvc is not initialized. vci is null.");
}
PageParameters param = new PageParameters();
param.add(NodeUtil.KEY_NODE, pvc.getNode().getName());
param.add(KEY_ATM_PORT, pvc.getPhysicalPort().getName());
param.add(KEY_ATM_PVC_VPI, pvc.getVpi().toString());
param.add(KEY_ATM_PVC_VCI, pvc.getVci().toString());
return param;
}
示例13: EmbeddedHierarchicalInstancePage
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public EmbeddedHierarchicalInstancePage(PageParameters parameters) {
// expect there to be a topicId parameter
super(parameters);
// find hierarchy topic
String hierarchyId = parameters.getString("hierarchyId");
if (hierarchyId == null)
this.hierarchyModel = new TopicModel<Topic>(getHierarchyTopic(getTopic()));
else
this.hierarchyModel = new TopicModel<Topic>(parameters.getString("topicMapId"), hierarchyId);
// create a tree
TreePanel treePanel = createTreePanel("treePanel", createTreeModel(new TopicModel<Topic>(getHierarchyTopic()), new TopicModel<Topic>(getTopic())));
treePanel.setOutputMarkupId(true);
add(treePanel);
}
示例14: SignInPage
import org.apache.wicket.PageParameters; //导入依赖的package包/类
public SignInPage(PageParameters params) {
super(params);
add(new StartPageHeaderPanel("header"));
add(new FooterPanel("footer"));
add(new Label("title", new ResourceModel("page.title.signin")));
add(new Label("message", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
OntopolySession session = (OntopolySession)Session.findOrCreate();
return session.getSignInMessage();
}
}));
add(new SignInForm("form"));
}
示例15: getPageParameters
import org.apache.wicket.PageParameters; //导入依赖的package包/类
@Override
public PageParameters getPageParameters(Topic topic) {
PageParameters params = new PageParameters();
params.put("topicMapId", topic.getTopicMap().getId());
params.put("topicId", topic.getId());
//! params.put("topicTypeId", getTopicType().getId());
FieldsView fieldsView = getFieldsView();
if (!fieldsView.isDefaultView())
params.put("viewId", fieldsView.getId());
PageParameters thisParams = getPageParameters();
// forward buttons parameter
if (thisParams.getString("buttons") != null)
params.put("buttons", "true");
return params;
}