Examples of JSMediaType


Examples of org.apache.jetspeed.serializer.objects.JSMediaType

      if ((mediaTypes != null) && (mediaTypes.size() > 0))
      {
        Iterator _it = mediaTypes.iterator();
        while (_it.hasNext())
        {
          JSMediaType _c = (JSMediaType)_it.next();
// create a new Media
          try
          {
            MediaType mediaType = caps.createMediaType(_c.getName());
          /** THE KEY_OVERWRITE_EXISTING test IS required for media types, since they carry no other information than the name
           *  Used here for consistency, though
           */          
            if ((this.getSetting(JetspeedSerializer.KEY_OVERWRITE_EXISTING)) || (mediaType.getMediatypeId() == 0))
            {
//               set object fields              
                  mediaType.setCharacterSet(_c.getCharacterSet());
                  mediaType.setTitle(_c.getTitle());
                  mediaType.setDescription(_c.getDescription());
                
                  try
                  {
                    _line = _c.getMimeTypesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                        int added = 0;
                        while (_it1.hasNext())
                        {
                          MimeType _mt = caps.createMimeType((String)_it1.next());
                          if (_mt != null)
                            mediaType.addMimetype(_mt);
                          added++;
                        }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
                  try
                  {
                    _line  = _c.getCapabilitiesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                      if ((list != null) && (list.size()>0))
                      {
                          int added = 0;
                          while (_it1.hasNext())
                          {
                            Capability _ct = caps.createCapability((String)_it1.next());
                            if (_ct != null)
                              mediaType.addCapability(_ct);
                            added++;
                          }
                      }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
              caps.storeMediaType(mediaType);
            }
            this.mediaMap.put(_c.getName(), mediaType);
          }
          catch (Exception e)
          {
            throw new SerializerException(
                      SerializerException.CREATE_OBJECT_FAILED
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        while (list.hasNext())
        {
            try
            {
                MediaType _mt = (MediaType) list.next();
                JSMediaType _jsM = new JSMediaType(_mt);
                // find the mimeTypes
                Iterator _itM = _mt.getMimetypes().iterator();
                while (_itM.hasNext())
                {
                    MimeType _m = (MimeType) _itM.next();
                    JSMimeType _mttype = (JSMimeType) mimeMap.get(_m.getName());
                    if (_mttype != null) _jsM.getMimeTypes().add(_mttype);
                }
                // find the capabilities
                Iterator _itC = _mt.getCapabilities().iterator();
                while (_itC.hasNext())
                {
                    Capability _c = (Capability) _itC.next();
                    JSCapability _ct = (JSCapability) capabilityMap.get(_c
                            .getName());
                    if (_ct != null) _jsM.getCapabilities().add(_ct);
                }
                this.mediaMap.put(_jsM.getName(), _jsM);
                ((JSSeedData)getSnapshot()).getMediaTypes().add(_jsM);
            } catch (Exception e)
            {
                // do whatever
                throw new SerializerException(
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

      if ((mediaTypes != null) && (mediaTypes.size() > 0))
      {
        Iterator _it = mediaTypes.iterator();
        while (_it.hasNext())
        {
          JSMediaType _c = (JSMediaType)_it.next();
// create a new Media
          try
          {
            MediaType mediaType = caps.createMediaType(_c.getName());
          /** THE KEY_OVERWRITE_EXISTING test IS required for media types, since they carry no other information than the name
           *  Used here for consistency, though
           */          
            if ((this.getSetting(JetspeedSerializer.KEY_OVERWRITE_EXISTING)) || (mediaType.getMediatypeId() == 0))
            {
//               set object fields              
                  mediaType.setCharacterSet(_c.getCharacterSet());
                  mediaType.setTitle(_c.getTitle());
                  mediaType.setDescription(_c.getDescription());
                
                  try
                  {
                    _line = _c.getMimeTypesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                        int added = 0;
                        while (_it1.hasNext())
                        {
                          MimeType _mt = caps.createMimeType((String)_it1.next());
                          if (_mt != null)
                            mediaType.addMimetype(_mt);
                          added++;
                        }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
                  try
                  {
                    _line  = _c.getCapabilitiesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                      if ((list != null) && (list.size()>0))
                      {
                          int added = 0;
                          while (_it1.hasNext())
                          {
                            Capability _ct = caps.createCapability((String)_it1.next());
                            if (_ct != null)
                              mediaType.addCapability(_ct);
                            added++;
                          }
                      }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
              caps.storeMediaType(mediaType);
            }
            this.mediaMap.put(_c.getName(), mediaType);
          }
          catch (Exception e)
          {
            throw new SerializerException(
                      SerializerException.CREATE_OBJECT_FAILED
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        while (list.hasNext())
        {
            try
            {
                MediaType _mt = (MediaType) list.next();
                JSMediaType _jsM = new JSMediaType(_mt);
                // find the mimeTypes
                Iterator _itM = _mt.getMimetypes().iterator();
                while (_itM.hasNext())
                {
                    MimeType _m = (MimeType) _itM.next();
                    JSMimeType _mttype = (JSMimeType) mimeMap.get(_m.getName());
                    if (_mttype != null) _jsM.getMimeTypes().add(_mttype);
                }
                // find the capabilities
                Iterator _itC = _mt.getCapabilities().iterator();
                while (_itC.hasNext())
                {
                    Capability _c = (Capability) _itC.next();
                    JSCapability _ct = (JSCapability) capabilityMap.get(_c
                            .getName());
                    if (_ct != null) _jsM.getCapabilities().add(_ct);
                }
                this.mediaMap.put(_jsM.getName(), _jsM);
                ((JSSeedData)getSnapshot()).getMediaTypes().add(_jsM);
            } catch (Exception e)
            {
                // do whatever
                throw new SerializerException(
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

      if ((mediaTypes != null) && (mediaTypes.size() > 0))
      {
        Iterator _it = mediaTypes.iterator();
        while (_it.hasNext())
        {
          JSMediaType _c = (JSMediaType)_it.next();
// create a new Media
          try
          {
            MediaType mediaType = caps.createMediaType(_c.getName());
          /** THE KEY_OVERWRITE_EXISTING test IS required for media types, since they carry no other information than the name
           *  Used here for consistency, though
           */          
            if ((this.getSetting(JetspeedSerializer.KEY_OVERWRITE_EXISTING)) || (mediaType.getMediatypeId() == 0))
            {
//               set object fields              
                  mediaType.setCharacterSet(_c.getCharacterSet());
                  mediaType.setTitle(_c.getTitle());
                  mediaType.setDescription(_c.getDescription());
                
                  try
                  {
                    _line = _c.getMimeTypesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                        int added = 0;
                        while (_it1.hasNext())
                        {
                          MimeType _mt = caps.createMimeType((String)_it1.next());
                          if (_mt != null)
                            mediaType.addMimetype(_mt);
                          added++;
                        }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
                  try
                  {
                    _line  = _c.getCapabilitiesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                      if ((list != null) && (list.size()>0))
                      {
                          int added = 0;
                          while (_it1.hasNext())
                          {
                            Capability _ct = caps.createCapability((String)_it1.next());
                            if (_ct != null)
                              mediaType.addCapability(_ct);
                            added++;
                          }
                      }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
              caps.storeMediaType(mediaType);
            }
            this.mediaMap.put(_c.getName(), mediaType);
          }
          catch (Exception e)
          {
            throw new SerializerException(
                      SerializerException.CREATE_OBJECT_FAILED
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        while (list.hasNext())
        {
            try
            {
                MediaType _mt = (MediaType) list.next();
                JSMediaType _jsM = new JSMediaType(_mt);
                // find the mimeTypes
                Iterator _itM = _mt.getMimetypes().iterator();
                while (_itM.hasNext())
                {
                    MimeType _m = (MimeType) _itM.next();
                    JSMimeType _mttype = (JSMimeType) mimeMap.get(_m.getName());
                    if (_mttype != null) _jsM.getMimeTypes().add(_mttype);
                }
                // find the capabilities
                Iterator _itC = _mt.getCapabilities().iterator();
                while (_itC.hasNext())
                {
                    Capability _c = (Capability) _itC.next();
                    JSCapability _ct = (JSCapability) capabilityMap.get(_c
                            .getName());
                    if (_ct != null) _jsM.getCapabilities().add(_ct);
                }
                this.mediaMap.put(_jsM.getName(), _jsM);
                ((JSSeedData)getSnapshot()).getMediaTypes().add(_jsM);
            } catch (Exception e)
            {
                // do whatever
                throw new SerializerException(
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

      if ((mediaTypes != null) && (mediaTypes.size() > 0))
      {
        Iterator _it = mediaTypes.iterator();
        while (_it.hasNext())
        {
          JSMediaType _c = (JSMediaType)_it.next();
// create a new Media
          try
          {
            MediaType mediaType = caps.createMediaType(_c.getName());
          /** THE KEY_OVERWRITE_EXISTING test IS required for media types, since they carry no other information than the name
           *  Used here for consistency, though
           */          
            if ((this.getSetting(JetspeedSerializer.KEY_OVERWRITE_EXISTING)) || (mediaType.getMediatypeId() == 0))
            {
//               set object fields              
                  mediaType.setCharacterSet(_c.getCharacterSet());
                  mediaType.setTitle(_c.getTitle());
                  mediaType.setDescription(_c.getDescription());
                
                  try
                  {
                    _line = _c.getMimeTypesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                        int added = 0;
                        while (_it1.hasNext())
                        {
                          MimeType _mt = caps.createMimeType((String)_it1.next());
                          if (_mt != null)
                            mediaType.addMimetype(_mt);
                          added++;
                        }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
                  try
                  {
                    _line  = _c.getCapabilitiesString().toString();
                    ArrayList list = this.getTokens(_line);
                    if ((list != null) && (list.size()>0))
                    {
                      Iterator _it1 = list.iterator();
                      if ((list != null) && (list.size()>0))
                      {
                          int added = 0;
                          while (_it1.hasNext())
                          {
                            Capability _ct = caps.createCapability((String)_it1.next());
                            if (_ct != null)
                              mediaType.addCapability(_ct);
                            added++;
                          }
                      }
                    }
                  }
                  catch (Exception e1)
                  {
                    e1.printStackTrace();
                  }
              caps.storeMediaType(mediaType);
            }
            this.mediaMap.put(_c.getName(), mediaType);
          }
          catch (Exception e)
          {
            throw new SerializerException(
                      SerializerException.CREATE_OBJECT_FAILED
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        while (list.hasNext())
        {
            try
            {
                MediaType _mt = (MediaType) list.next();
                JSMediaType _jsM = new JSMediaType(_mt);
                // find the mimeTypes
                Iterator _itM = _mt.getMimetypes().iterator();
                while (_itM.hasNext())
                {
                    MimeType _m = (MimeType) _itM.next();
                    JSMimeType _mttype = (JSMimeType) mimeMap.get(_m.getName());
                    if (_mttype != null) _jsM.getMimeTypes().add(_mttype);
                }
                // find the capabilities
                Iterator _itC = _mt.getCapabilities().iterator();
                while (_itC.hasNext())
                {
                    Capability _c = (Capability) _itC.next();
                    JSCapability _ct = (JSCapability) capabilityMap.get(_c
                            .getName());
                    if (_ct != null) _jsM.getCapabilities().add(_ct);
                }
                this.mediaMap.put(_jsM.getName(), _jsM);
                ((JSSeedData)getSnapshot()).getMediaTypes().add(_jsM);
            } catch (Exception e)
            {
                // do whatever
                throw new SerializerException(
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        if ((mediaTypes != null) && (mediaTypes.size() > 0))
        {
            Iterator _it = mediaTypes.iterator();
            while (_it.hasNext())
            {
                JSMediaType _c = (JSMediaType) _it.next();
                // create a new Media
                try
                {
                    MediaType mediaType = caps.createMediaType(_c.getName());
                    /**
                     * THE KEY_OVERWRITE_EXISTING test IS required for media
                     * types, since they carry no other information than the
                     * name Used here for consistency, though
                     */
                    if ((isSettingSet(settings, JetspeedSerializer.KEY_OVERWRITE_EXISTING))
                            || (mediaType.getMediatypeId() == 0))
                    {
                        // set object fields
                        mediaType.setCharacterSet(_c.getCharacterSet());
                        mediaType.setTitle(_c.getTitle());
                        mediaType.setDescription(_c.getDescription());

                        try
                        {
                            _line = _c.getMimeTypesString().toString();
                            List<String> list = getTokens(_line);
                            if ((list != null) && (list.size() > 0))
                            {
                                Iterator<String> _it1 = list.iterator();
                                int added = 0;
                                while (_it1.hasNext())
                                {
                                    MimeType _mt = caps.createMimeType((String) _it1.next());
                                    if (_mt != null)
                                        mediaType.addMimetype(_mt);
                                    added++;
                                }
                            }
                        }
                        catch (Exception e1)
                        {
                            e1.printStackTrace();
                        }
                        try
                        {
                            _line = _c.getCapabilitiesString().toString();
                            List<String> list = getTokens(_line);
                            if ((list != null) && (list.size() > 0))
                            {
                                Iterator<String> _it1 = list.iterator();
                                if ((list != null) && (list.size() > 0))
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSMediaType

        while (list.hasNext())
        {
            try
            {
                MediaType _mt = (MediaType) list.next();
                JSMediaType _jsM = new JSMediaType(_mt);
                // find the mimeTypes
                Iterator _itM = _mt.getMimetypes().iterator();
                while (_itM.hasNext())
                {
                    MimeType _m = (MimeType) _itM.next();
                    JSMimeType _mttype = (JSMimeType) refs.mimeMap.get(_m.getName());
                    if (_mttype != null) _jsM.getMimeTypes().add(_mttype);
                }
                // find the capabilities
                Iterator _itC = _mt.getCapabilities().iterator();
                while (_itC.hasNext())
                {
                    Capability _c = (Capability) _itC.next();
                    JSCapability _ct = (JSCapability) refs.capabilityMap.get(_c
                            .getName());
                    if (_ct != null) _jsM.getCapabilities().add(_ct);
                }
                refs.mediaMap.put(_jsM.getName(), _jsM);
                snapshot.getMediaTypes().add(_jsM);
            } catch (Exception e)
            {
                // do whatever
                throw new SerializerException(
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.