@Nonnull public static HCA createEditLink (@Nonnull final ILayoutExecutionContext aLEC, @Nonnull final IHasID <String> aCurObject, @Nullable final String sTitle, @Nullable final Map <String, String> aParams) { final ISimpleURL aEditURL = createEditURL (aLEC, aCurObject).addAll (aParams); return new HCA (aEditURL).setTitle (sTitle).addChild (getEditImg ()); }
/** * @param aRequestScope * The request web scope to be used. Required for cookie-less handling. * May not be <code>null</code>. * @param aParams * An optional map with URL parameters to be used in the URL. May be * <code>null</code> or empty. * @return The URI where the AJAX function can be invoked. Neither * <code>null</code> nor empty. */ @Nonnull @Nonempty default String getInvocationURI (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nullable final Map <String, String> aParams) { if (aParams == null || aParams.isEmpty ()) { // No need to convert to SimpleURL and back return getInvocationURI (aRequestScope); } return getInvocationURL (aRequestScope).addAll (aParams).getAsStringWithEncodedParameters (); }
/** * Throw a {@link ForcedRedirectException} with the self href of the current * layout context. This immediately stops the request and sends a HTTP * redirect to the client. * * @param aContent * The content to be displayed next time the page is rendered via GET. * May be <code>null</code>. * @param aAdditionalParameters * Additional parameters to be added to the request. May be * <code>null</code> or empty. * @throws ForcedRedirectException * Every time, since this is the P-R-G indicator. */ default void postRedirectGetInternal (@Nullable final IHCNode aContent, @Nullable final Map <String, String> aAdditionalParameters) throws ForcedRedirectException { // Add the "PRG active" parameter postRedirectGet (getSelfHref ().add (ForcedRedirectManager.REQUEST_PARAMETER_PRG_ACTIVE) .addAll (aAdditionalParameters), aContent); }
@Override @Nonnull protected BootstrapButtonToolbar createViewToolbar (@Nonnull final WebPageExecutionContext aWPEC, final boolean bCanGoBack, @Nonnull final ISMPServiceInformation aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final ISMPProcess aSelectedProcess = aWPEC.getRequestScope ().attrs ().getCastedValue (REQUEST_ATTR_PROCESS); final ISMPEndpoint aSelectedEndpoint = aWPEC.getRequestScope ().attrs ().getCastedValue (REQUEST_ATTR_ENDPOINT); final BootstrapButtonToolbar aToolbar = createNewViewToolbar (aWPEC); if (bCanGoBack) { // Back to list aToolbar.addButtonBack (aDisplayLocale); } if (isActionAllowed (aWPEC, EWebPageFormAction.EDIT, aSelectedObject)) { // Edit object aToolbar.addButtonEdit (aDisplayLocale, createEditURL (aWPEC, aSelectedObject).addAll (_createParamMap (aSelectedObject, aSelectedProcess, aSelectedEndpoint))); } // Callback modifyViewToolbar (aWPEC, aSelectedObject, aToolbar); return aToolbar; }
@Override @Nonnull protected BootstrapButtonToolbar createViewToolbar (@Nonnull final WebPageExecutionContext aWPEC, final boolean bCanGoBack, @Nonnull final ISMPServiceInformation aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final ISMPProcess aSelectedProcess = aWPEC.getRequestScope ().attrs ().getCastedValue (REQUEST_ATTR_PROCESS); final ISMPEndpoint aSelectedEndpoint = aWPEC.getRequestScope ().attrs ().getCastedValue (REQUEST_ATTR_ENDPOINT); final BootstrapButtonToolbar aToolbar = createNewViewToolbar (aWPEC); if (bCanGoBack) { // Back to list aToolbar.addButtonBack (aDisplayLocale); } if (isActionAllowed (aWPEC, EWebPageFormAction.EDIT, aSelectedObject)) { // Edit object aToolbar.addButtonEdit (aDisplayLocale, createEditURL (aWPEC, aSelectedObject).addAll (_createParamMap (aSelectedObject, aSelectedProcess, aSelectedEndpoint))); } // Callback modifyViewToolbar (aWPEC, aSelectedObject, aToolbar); return aToolbar; }
public HCYouTubeEmbed (final int nWidth, final int nHeight, @Nonnull @Nonempty final String sVideoID, final boolean bAllowFullScreen) { final ISimpleURL aBaseURL = new SimpleURL (PREFIX + sVideoID); setWidth (nWidth); setHeight (nHeight); final HCParam aParamMovie = addAndReturnChild (new HCParam ("movie")); final HCParam aParamAllowFullScreen = addAndReturnChild (new HCParam ("allowFullScreen")); aParamAllowFullScreen.setValue (Boolean.toString (bAllowFullScreen)); addChild (new HCParam ("allowscriptaccess").setValue ("always")); final HCEmbed aEmbed = addAndReturnChild (new HCEmbed ()); aEmbed.setType (CMimeType.APPLICATION_SHOCKWAVE_FLASH); aEmbed.setCustomAttr ("allowscriptaccess", "always"); aEmbed.setWidth (nWidth); aEmbed.setHeight (nHeight); aEmbed.setCustomAttr ("allowfullscreen", Boolean.toString (bAllowFullScreen)); // Build the correct URL based on the passed settings final SMap aURLParams = new SMap ("hl", "en_US"); aURLParams.add ("fs", bAllowFullScreen ? "1" : "0"); final ISimpleURL aURL = new SimpleURL (aBaseURL).addAll (aURLParams); aParamMovie.setValue (aURL.getAsString ()); aEmbed.setSrc (aURL); } }
aRow.addCell (aCurObject.getTargetHref ()); final ISimpleURL aEditURL = createEditURL (aWPEC, aCurObject).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aCurObject).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aCurObject).addAll (aParams); aRow.addCell (new HCA (aEditURL).setTitle ("Edit " + sDisplayName).addChild (EDefaultIcon.EDIT.getAsNode ()), new HCTextNode (" "),
aRow.addCell (aCurObject.getTargetHref ()); final ISimpleURL aEditURL = createEditURL (aWPEC, aCurObject).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aCurObject).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aCurObject).addAll (aParams); aRow.addCell (new HCA (aEditURL).setTitle ("Edit " + sDisplayName).addChild (EDefaultIcon.EDIT.getAsNode ()), new HCTextNode (" "),
final ISimpleURL aEditURL = createEditURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aPreviewURL = LinkHelper.getURLWithServerAndContext (aServiceInfo.getServiceGroup () .getParticpantIdentifier () .addAll (_createParamMap (aServiceInfo, aProcess, (ISMPEndpoint) null)) .add (CPageParam.PARAM_ACTION, ACTION_DELETE_PROCESS)) .setTitle ("Delete process") .addAll (_createParamMap (aServiceInfo, (ISMPProcess) null, (ISMPEndpoint) null)) aEndpoint.getTransportProfile ())).addChild (aEndpoint.getTransportProfile ())); final ISimpleURL aEditURL = createEditURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aPreviewURL = LinkHelper.getURLWithServerAndContext (aServiceInfo.getServiceGroup () .getParticpantIdentifier ()
final ISimpleURL aEditURL = createEditURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aPreviewURL = LinkHelper.getURLWithServerAndContext (aServiceInfo.getServiceGroup () .getParticpantIdentifier () .addAll (_createParamMap (aServiceInfo, aProcess, (ISMPEndpoint) null)) .add (CPageParam.PARAM_ACTION, ACTION_DELETE_PROCESS)) .setTitle ("Delete process") .addAll (_createParamMap (aServiceInfo, (ISMPProcess) null, (ISMPEndpoint) null)) aEndpoint.getTransportProfile ())).addChild (aEndpoint.getTransportProfile ())); final ISimpleURL aEditURL = createEditURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aCopyURL = createCopyURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aDeleteURL = createDeleteURL (aWPEC, aServiceInfo).addAll (aParams); final ISimpleURL aPreviewURL = LinkHelper.getURLWithServerAndContext (aServiceInfo.getServiceGroup () .getParticpantIdentifier ()
m_aDisplayLocale.getLanguage ()); if (m_aTextLoadingParams != null) aFinalURL.addAll (m_aTextLoadingParams); aLanguage = new JsonObject ().add ("url", aFinalURL.getAsString ());