Examples of LayoutException


Examples of ar.com.fdvs.dj.core.layout.LayoutException

  private DJCrosstab crosstab = new DJCrosstab();

  public DJCrosstab build(){
    if (crosstab.getMeasures().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one measure");
    }
    return crosstab;
  }
View Full Code Here

Examples of ar.com.fdvs.dj.core.layout.LayoutException

  private DJCrosstab crosstab = new DJCrosstab();

  public DJCrosstab build(){
    if (crosstab.getMeasures().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one measure");
    }
    return crosstab;
  }
View Full Code Here

Examples of ar.com.fdvs.dj.core.layout.LayoutException

   * Build the crosstab. Throws LayoutException if anything is wrong
   * @return
   */
  public DJCrosstab build(){
    if (crosstab.getMeasures().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one measure");
    }
    if (crosstab.getColumns().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one column");
    }
    if (crosstab.getRows().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one row");
    }
   
   
    //Ensure default dimension values
    for (Iterator iterator = crosstab.getColumns().iterator(); iterator.hasNext();) {
View Full Code Here

Examples of ar.com.fdvs.dj.core.layout.LayoutException

  private DJCrosstab crosstab = new DJCrosstab();

  public DJCrosstab build(){
    if (crosstab.getMeasures().isEmpty()){
      throw new LayoutException("Crosstabs must have at least one measure");
    }
    return crosstab;
  }
View Full Code Here

Examples of com.evelopers.unimod.glayout.utils.LayoutException

     * @see com.evelopers.unimod.glayout.validators.IValidator#execute()
     */
    public void execute() throws LayoutException {
        if (VALIDATORS_ON) {
            if (!validate()) {
                throw new LayoutException("" + this.getClass().getName() + " not passed");
            }
        }
    }
View Full Code Here

Examples of com.volantis.mcs.layouts.LayoutException

            // Get the layout.
            if (layoutName != null) {
                RuntimeDeviceLayout deviceLayout =
                        getDeviceLayout(layoutName);
                if (deviceLayout == null) {
                    throw new LayoutException(EXCEPTION_LOCALIZER.format(
                            "no-suitable-device-layout",
                            new Object[]{layoutName,
                                         getDeviceName()}));
                }
View Full Code Here

Examples of com.volantis.mcs.layouts.LayoutException

        if (fragmentName != null) {
            fragment =
                    (Fragment) getDeviceLayout().retrieveFormat(fragmentName,
                                                                FormatType.FRAGMENT);
            if (fragment == null) {
                throw new LayoutException(EXCEPTION_LOCALIZER.format(
                        "fragment-missing", fragmentName));
            }
        }

        if (logger.isDebugEnabled()) {
View Full Code Here

Examples of com.volantis.mcs.layouts.LayoutException

                // we are looking for is contained in a fragment inside the
                // device layout format.
                fragment = (FormFragment) getCurrentFragment().retrieveFormat(
                        formFragmentName, FormatType.FORM_FRAGMENT);
                if (fragment == null) {
                    throw new LayoutException(EXCEPTION_LOCALIZER.format(
                            "form-fragment-missing", formFragmentName));
                }
            }
        }
View Full Code Here

Examples of org.apache.archiva.repository.layout.LayoutException

         */

        if ( pathParts.length != 3 )
        {
            // Illegal Path Parts Length.
            throw new LayoutException( INVALID_ARTIFACT_PATH
                                           + "legacy paths should only have 3 parts [groupId]/[type]s/[artifactId]-[version].[type], found "
                                           + pathParts.length + " instead." );
        }

        // The Group ID.
        artifact.setGroupId( pathParts[0] );

        // The Expected Type.
        String expectedType = pathParts[1];

        // Sanity Check: expectedType should end in "s".
        if ( !expectedType.endsWith( "s" ) )
        {
            throw new LayoutException( INVALID_ARTIFACT_PATH
                                           + "legacy paths should have an expected type ending in [s] in the second part of the path." );
        }

        // The Filename.
        String filename = pathParts[2];

        FilenameParser parser = new FilenameParser( filename );

        artifact.setArtifactId( parser.nextNonVersion() );

        // Sanity Check: does it have an artifact id?
        if ( StringUtils.isEmpty( artifact.getArtifactId() ) )
        {
            // Special Case: The filename might start with a version id (like "test-arch-1.0.jar").
            int idx = filename.indexOf( '-' );
            if ( idx > 0 )
            {
                parser.reset();
                // Take the first section regardless of content.
                String artifactId = parser.next();

                // Is there anything more that is considered not a version id?
                String moreArtifactId = parser.nextNonVersion();
                if ( StringUtils.isNotBlank( moreArtifactId ) )
                {
                    artifact.setArtifactId( artifactId + "-" + moreArtifactId );
                }
                else
                {
                    artifact.setArtifactId( artifactId );
                }
            }

            // Sanity Check: still no artifact id?
            if ( StringUtils.isEmpty( artifact.getArtifactId() ) )
            {
                throw new LayoutException( INVALID_ARTIFACT_PATH + "no artifact id present." );
            }
        }

        artifact.setVersion( parser.remaining() );

        // Sanity Check: does it have a version?
        if ( StringUtils.isEmpty( artifact.getVersion() ) )
        {
            // Special Case: use last section of artifactId as version.
            String artifactId = artifact.getArtifactId();
            int idx = artifactId.lastIndexOf( '-' );
            if ( idx > 0 )
            {
                artifact.setVersion( artifactId.substring( idx + 1 ) );
                artifact.setArtifactId( artifactId.substring( 0, idx ) );
            }
            else
            {
                throw new LayoutException( INVALID_ARTIFACT_PATH + "no version found." );
            }
        }

        String classifier = ArtifactClassifierMapping.getClassifier( expectedType );
        if ( classifier != null )
        {
            String version = artifact.getVersion();
            if ( !version.endsWith( "-" + classifier ) )
            {
                throw new LayoutException(
                    INVALID_ARTIFACT_PATH + expectedType + " artifacts must use the classifier " + classifier );
            }
            version = version.substring( 0, version.length() - classifier.length() - 1 );
            artifact.setVersion( version );
            artifact.setClassifier( classifier );
        }

        String extension = parser.getExtension();

        // Set Type
        String defaultExtension = expectedType.substring( 0, expectedType.length() - 1 );
        artifact.setType(
            ArtifactExtensionMapping.mapExtensionAndClassifierToType( classifier, extension, defaultExtension ) );

        // Sanity Check: does it have an extension?
        if ( StringUtils.isEmpty( artifact.getType() ) )
        {
            throw new LayoutException( INVALID_ARTIFACT_PATH + "no extension found." );
        }

        // Special Case with Maven Plugins
        if ( StringUtils.equals( "jar", extension ) && StringUtils.equals( "plugins", expectedType ) )
        {
            artifact.setType( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN );
        }
        else
        {
            // Sanity Check: does extension match pathType on path?
            String expectedExtension = ArtifactExtensionMapping.getExtension( artifact.getType() );

            if ( !expectedExtension.equals( extension ) )
            {
                throw new LayoutException(
                    INVALID_ARTIFACT_PATH + "mismatch on extension [" + extension + "] and layout specified type ["
                        + artifact.getType() + "] (which maps to extension: [" + expectedExtension + "]) on path ["
                        + path + "]" );
            }
        }
View Full Code Here

Examples of org.apache.archiva.repository.layout.LayoutException

    public ArtifactReference toArtifactReference( String requestedPath )
        throws LayoutException
    {
        if ( StringUtils.isBlank( requestedPath ) )
        {
            throw new LayoutException( "Blank request path is not a valid." );
        }

        String path = requestedPath;
        while ( path.startsWith( "/" ) )
        {
            path = path.substring( 1 );

            // Only slash? that's bad, mmm-kay?
            if ( "/".equals( path ) )
            {
                throw new LayoutException( "Invalid request path: Slash only." );
            }
        }

        if ( isDefault( path ) )
        {
            return defaultPathParser.toArtifactReference( path );
        }
        else if ( isLegacy( path ) )
        {
            return legacyPathParser.toArtifactReference( path );
        }
        else
        {
            throw new LayoutException( "Not a valid request path layout, too short." );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.