Package org.chromattic.ext.ntdef

Examples of org.chromattic.ext.ntdef.Resource


            LocalGadgetData data = (LocalGadgetData)def.getData();
            String fileName = gadget.getName() + ".xml";
            data.setFileName(fileName);
            data.getResources().createFile(
               fileName,
               new Resource("application.xml", "UTF-8", ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                  + "<Module><ModulePrefs title=\"\" />" + "<Content type=\"html\"> <![CDATA[]]>" + "</Content>"
                  + "</Module>").getBytes("UTF-8")));
         }
         else
         {
View Full Code Here


                if (resourcePath.equals(uri)) {
                    mimeType = LocalGadgetData.GADGET_MIME_TYPE;
                }

                //
                folder.createFile(name, new Resource(mimeType, encoding, content));
            }
        } else {
            folder = folder.createFolder(name);
            visitChildren(uri, resourcePath);
            folder = folder.getParent();
View Full Code Here

                LocalGadgetData data = (LocalGadgetData) def.getData();
                String fileName = gadget.getName() + ".xml";
                data.setFileName(fileName);
                data.getResources().createFile(
                        fileName,
                        new Resource("application.xml", "UTF-8", ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                                + "<Module><ModulePrefs title=\"\" />" + "<Content type=\"html\"> <![CDATA[]]>" + "</Content>"
                                + "</Module>").getBytes("UTF-8")));
            } else {
                def.setLocal(false);
                RemoteGadgetData data = (RemoteGadgetData) def.getData();
View Full Code Here

        //
        if (data instanceof LocalGadgetData) {
            try {
                String gadgetName = def.getName();
                LocalGadgetData localData = (LocalGadgetData) data;
                Resource resource = localData.getResources().getFile(localData.getFileName()).getContentResource();
                String content = new String(resource.getData(), resource.getEncoding());
                GadgetSpec gadgetSpec = new GadgetSpec(Uri.parse(getGadgetURL(gadgetName)), content);
                ModulePrefs prefs = gadgetSpec.getModulePrefs();

                String title = prefs.getDirectoryTitle();
                if (title == null || title.trim().length() < 1) {
View Full Code Here

        def.setTitle(prefs.getTitle());
        def.setReferenceURL(prefs.getTitleUrl().toString());

        // Update content
        NTFile content = getGadgetContent();
        content.setContentResource(new Resource(GADGET_MIME_TYPE, encoding, bytes));
    }
View Full Code Here

        content.setContentResource(new Resource(GADGET_MIME_TYPE, encoding, bytes));
    }

    public String getSource() throws Exception {
        NTFile content = getGadgetContent();
        Resource res = content.getContentResource();
        String encoding = res.getEncoding();
        byte[] bytes = res.getData();
        return new String(bytes, encoding);
    }
View Full Code Here

            if (resourcePath.equals(gadgetPath)) {
               mimeType = LocalGadgetData.GADGET_MIME_TYPE;
            }

            //
            folder.createFile(name, new Resource(mimeType, encoding, content));
         }
      }
      else
      {
         folder = folder.createFolder(name);
View Full Code Here

            LocalGadgetData data = (LocalGadgetData)def.getData();
            String fileName = gadget.getName() + ".xml";
            data.setFileName(fileName);
            data.getResources().createFile(
               fileName,
               new Resource("application.xml", "UTF-8", ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                  + "<Module><ModulePrefs title=\"\" />" + "<Content type=\"html\"> <![CDATA[]]>" + "</Content>"
                  + "</Module>").getBytes("UTF-8")));
         }
         else
         {
View Full Code Here

      def.setTitle(prefs.getTitle());
      def.setReferenceURL(prefs.getTitleUrl().toString());

      // Update content
      NTFile content = getGadgetContent();
      content.setContentResource(new Resource(GADGET_MIME_TYPE, encoding, bytes));
   }
View Full Code Here

   }

   public String getSource() throws Exception
   {
      NTFile content = getGadgetContent();
      Resource res = content.getContentResource();
      String encoding = res.getEncoding();
      byte[] bytes = res.getData();
      return new String(bytes, encoding);
   }
View Full Code Here

TOP

Related Classes of org.chromattic.ext.ntdef.Resource

Copyright © 2018 www.massapicom. 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.