public static boolean inProcess() { boolean inProcess = false; boolean remoteDiServer = BooleanUtils.toBoolean( PentahoSystem.getSystemSetting( REMOTE_DI_SERVER_INSTANCE, "false" ) ); //$NON-NLS-1$ if ( "true".equals( PentahoSystem.getSystemSetting( SINGLE_DI_SERVER_INSTANCE, "true" ) ) ) { //$NON-NLS-1$ //$NON-NLS-2$ inProcess = true; } else if ( !remoteDiServer && PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() != null ) { inProcess = true; } return inProcess; } }
+ "<description>" + SINGLE_DI_SERVER_INSTANCE + "</description>" //$NON-NLS-1$ //$NON-NLS-2$ + "<repository_location_url>" + PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() + "</repository_location_url>" //$NON-NLS-1$ //$NON-NLS-2$ + "<version_comment_mandatory>N</version_comment_mandatory>" //$NON-NLS-1$
public BasePentahoRequestContext( String contextPath ) { super(); if ( contextPath != null ) { String draftPath = contextPath + ( contextPath.endsWith( SLASH ) ? EMPTY : SLASH ); this.contextPath = draftPath.replaceAll( "(?<!^http:)(/){2,}", SLASH ); } else { String path = PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); this.contextPath = path + ( path != null && path.endsWith( SLASH ) ? EMPTY : SLASH ); } }
/** * Returns the IPentahoRequestContext for the current thread * * @return thread requestContext */ public static IPentahoRequestContext getRequestContext() { if ( strategy != null && strategy.getRequestContext() != null ) { return strategy.getRequestContext(); } else { if ( PentahoSystem.getInitializedOK() ) { return new BasePentahoRequestContext( PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); } else { try{ logger.debug( "Something went wrong. Trying to proceed. System is in status " + PentahoSystem.getInitializedStatus() ); if( PentahoSystem.getApplicationContext() != null && PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() != null ){ return new BasePentahoRequestContext( PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); } } catch(Exception ex){ logger.debug( "Restore attempt failed ", ex ); } return null; } } }
private static void registerHostnameVerifier() { try { final String LOCALHOST = "localhost"; //$NON-NLS-1$ String tmphost = "localhost"; //$NON-NLS-1$ try { String fullyQualifiedServerURL = PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); if ( null == fullyQualifiedServerURL ) { return; } URL url = new URL( fullyQualifiedServerURL ); tmphost = url.getHost(); } catch ( MalformedURLException e ) { Logger.warn( PentahoSystem.class.getName(), Messages.getInstance().getErrorString( "PentahoSystem.ERROR_0030_VERIFIER_FAILED" ), e ); //$NON-NLS-1$ } final String host = tmphost; javax.net.ssl.HostnameVerifier myHv = new javax.net.ssl.HostnameVerifier() { public boolean verify( String hostName, javax.net.ssl.SSLSession session ) { if ( hostName.equals( host ) || hostName.equals( LOCALHOST ) ) { return true; } return false; } }; javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( myHv ); } catch ( Throwable t ) { Logger.warn( PentahoSystem.class.getName(), Messages.getInstance().getErrorString( "PentahoSystem.ERROR_0030_VERIFIER_FAILED" ), t ); //$NON-NLS-1$ } }
public static String getSystemInput( final String inputName, final IRuntimeContext context ) { int i = TemplateUtil.SystemInputs.indexOf( inputName ); switch ( i ) { case 0: { // User return context.getSession().getName(); } case 1: { // Relative URL return PentahoRequestContextHolder.getRequestContext().getContextPath(); } case 2: { // Solution return PentahoSystem.getApplicationContext().getSolutionPath( "" ); //$NON-NLS-1$ } case 3: { // Fully Qualified Server URL return PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); } } return null; }
urlTemplate += PentahoSystem.getApplicationContext().getFullyQualifiedServerURL();
String fullyQualifiedServerURL = PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); URL url = null; try {
if ( PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() != null ) { fullyQualifiedServerUrl = PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); if ( url.endsWith( "/" ) ) { //$NON-NLS-1$ url = url.substring( 0, url.length() - 2 );
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Element root = result.addElement( "widget" ); //$NON-NLS-1$ root.addElement( "title" ).setText( title ); //$NON-NLS-1$
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$ Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$ Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); setXslProperty( "baseUrl", requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$ Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );
setXslProperty( "fullyQualifiedServerUrl", PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String mapName = "chart" + AbstractChartComponent.chartCount++; //$NON-NLS-1$ Document chartDefinition = jcrHelper.getSolutionDocument( definitionPath, RepositoryFilePermission.READ );