Pages

Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Wednesday, March 11, 2015

Download or print Google docs viewer file

Today I was amazed by not being able to properly print a Google Docs Viewer file. Not sure if that was due to some protection of the document, but it was really not nice. All I got from printing was the first page. Through PDF or direct print. No "Download" button or anything like it. I assume it is due to protection levels anyway.

After few minutes, the only solution possible was:

1. Open Firefox
2. Install "downthemall"
3. Scroll through all the file so all the images render
4. Select "DownThemAll" from the blank space in the centre of the page


Got all the images to my local disk, so then just selected them all and print (now this is really good feature in Windows 7, congratulations MS).
Read more »

Upload all file types to any Google Account

Over the next few days we will be rolling out an expansion to the feature set of the Google Documents List API. Third-party applications may now upload files of any type to any Google Account. Previously, this was only possible for Google Apps for Business users.

This feature allows developers to roll out their solutions to all Google Docs users. For instance, it’s now possible for developers to build applications that allow all users to back up files from their local hard drive to the cloud. There are a variety of other possible uses for this feature, and some examples include revision control and file distribution. Third-party applications (such as those on the Google Apps Marketplace) can also now use Google Docs as the primary place to store their data without the hassle of creating different solutions for customers of Google Apps for Business versus the free edition of Google Apps.

After they are uploaded, files are available in the Google Docs interface:


To enable uploads for all file types, developers must use the resumable upload feature of the API, and also pass in the ?convert=false URL parameter.

We have also added checksums to all files that are not converted to a native Google Docs format. This means that if you upload a file type we cant convert, or if you choose not to convert a file to a native format, a checksum is now available to help guarantee the integrity of the file between storage and retrieval.

We are also in the process of adding checksums to all previously uploaded unconverted files. Due to the popularity of uploading unconverted files, processing this backlog will take some time to complete.

We’ve recently made a lot of improvements to the documentation that should make implementing all of this easier. For further help, please have a look in the forum.

Want to weigh in on this topic? Discuss on Buzz

Read more »

Monday, March 9, 2015

Documents List API now supports more file types

We are happy to announce that we have recently launched support for creating and managing revisions for arbitrary file types in the Documents List API. Prior to this, the Documents List API only allowed developers to create and query revisions of Google Docs files.

This opens up the API for a number of exciting use cases. For example, a developer could use Google Docs as the cloud-based back-end for a content-management system with versioning. Another possibility would be for developers to provide file history or file playback in their sync clients.

Please note, however, that while all users can use the API to query and manage revisions, currently only Google Apps Premier users can upload arbitrary file types via the API. All users are still able to upload arbitrary files types via the Google Docs web interface.

For more information on how to use this new feature, please see the updated release notes and updated documentation.

Want to weigh in on this topic? Discuss on Buzz

Read more »

Tuesday, February 3, 2015

How to convert NetApp MOF file to Java Bean


NetApp Storage Device

SMI-S Support
Introduction:

Initially, EMC is the leading market player providing remote infrastructure management devices. Later, NetApp came up with an idea to solve scratch level problems with storage devices. As the trend goes on, with the initiation of SNIA organization, Storage Management Initiative Specification (SMI-S) which provides vendor neutral platform to manage storage devices.

Procedure to manage NetApp storage device using SMI-S:

We need to install SMI-S Provider before we move on. We query this SMI-S Provider to get the data from the storage device. When we query the SMI-S Provider, it communicates with the storage device and gets required data for us. To query the SMI-S Provider we need to prepare Java Beans.

Questions been asked:

Is there any way to directly get Java Beans to support SMI-S for NetApp Storage Device?
How to query Google first to get the necessary help?
Answer is, looks like there are some handful resources but nothing of them makes me feel great.
Here is my effort to make this article a feel good factor for everyone.

Research and Development: (RnD)

I don’t think installing SMI-S Provider is a big deal. Just double click on the respective .exe file. Now, go to the installation directory and search for the zip folder named agent_mof.  Extract it and go through the files content to analyze the device. You will find the .mof files there. You can generate beans from these .mof files.

Related Terminology: If you don’t want just skip it and directly enter into program

Cloud Service Provider (CSP):

Cloud Service Provider offers software or storage services. Those services are made available using public or private cloud.

Remote Infrastructure Management (RIM):

Remote Infrastructure Management is managing small to big devices remotely. It allows IT teams concentrate on strategic goals rather than managing IT operations

Storage Device:

As the name suggests, Storage Device is nothing but an equipment capable of storing huge information in it.

MOF File:

Managed Object Format file is the description for Java classes and instances. It is format Unicode or UTF-8.

Take for example, MOF File named ontap_battery.mof

Java Code to prepare Java class for this MOF file: JavaBeanMOF.java

package moftobean.netapp;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.HashMap;
import java.util.StringTokenizer;

public class JavaBeanMOF {
/**
* @param args
*/
public static void main(String[] args) {
try {
int i;
FileOutputStream fout = null;
File f2;
File f = new File("D:/SVNSTSWorkspace/NetApp Bean Generator/src/moftobean/netapp/ontap_battery.mof");
// folder name that the bean files will reside in a package
String namespace = "netapp";
FileReader fin = new FileReader(f);
BufferedReader bin = new BufferedReader(fin);
String line = null;
HashMap <string string=""> map = new HashMap<string string="">();
while((line = bin.readLine()) != null) {
if(line.trim().startsWith("class")) {
if(map.get(line) == null) {
map.put(line, line);
String cname = line.split(" ")[1];
String name = "D:/SVNSTSWorkspace/NetApp Bean Generator/src/moftobean/netapp/" + cname + ".java";
String packagePath = "package moftobean." + namespace + ";

";
f2 = new File(name);
fout = new FileOutputStream(f2);
fout.write(packagePath.getBytes());
i = 0;
if(line.contains(":")) {
//separate’s tokens based on space and colon
StringTokenizer st = new StringTokenizer(line,"[ :]");
String[] tokenlist = new String[st.countTokens()];
while (st.hasMoreTokens()) {
tokenlist[i] = st.nextToken();
i++;
}
String str1;
if(tokenlist[1].startsWith("ONTAP_") || tokenlist[3].startsWith("CIM_")) {
str1 = "public "+tokenlist[0]+" "+tokenlist[1]+" "+"extends"+" "+tokenlist[2]+" {";
System.out.println(str1);
fout.write((str1+"
").getBytes());
}
}
}

}
if(line.trim().endsWith(";") &amp;&amp; !line.trim().startsWith("}")) {
String[] tokens = line.trim().split(" ");

if(tokens.length == 2) {
for(String token: tokens) {
if(token.trim().equalsIgnoreCase("string")) {
line = "String ";
} else if(token.trim().equalsIgnoreCase("uint16")) {
line = "UnsignedInteger16 " ;
}
// continue if you have more variable types in MOF file

if(token.trim().endsWith(";")) {
line = line+token;
}
}
}
System.out.println(line);
fout.write((line + "
").getBytes());
}
if(line.trim().startsWith("}") &amp;&amp; line.trim().endsWith(";")) {
System.out.println("}");
fout.write(("}" + "
").getBytes());
}

}
bin.close();
} catch(Exception e) { e.printStackTrace(); }
}
}

Output: Two Java files are generated with the respective names.

ONTAP_Battery.java

package moftobean.netapp;

public class ONTAP_Battery extends CIM_Battery {
String SystemCreationClassName;
String SystemName;
String CreationClassName;
String DeviceID;
String Description;
String ElementName;
UnsignedInteger16 BatteryStatus;
}

ONTAP_StorageSystemBattery.java

package moftobean.netapp;

public class ONTAP_StorageSystemBattery extends CIM_SystemDevice {
ONTAP_StorageSystem REF GroupComponent;
ONTAP_Battery REF PartComponent;
}

Now, using the output files you can generate bean(setters and getters) using eclipse IDE.

The generated output files shows errors. No need worry about them. Just create CIM_SystemDevice and CIM_Battery as empty. They need to be there because “ONTAP_” classes extends “CIM_”
Classes.

And add cim-2.0.0.jar to the class path to resolve data type support errors.

This code is confined to the ONTAP_Battery.mof. Had to change to support all other .mof files if needed.

Variables uint6, string are same as UnsignedInteger16, String variables in Java language. Googling will get you complete list of mapping between CIM Element and Java Element. You will find them in oracle site.

MOF file is not provided here due to some reasons. You can work through the example as MOF files can be found in any windows system. Just type ext:mof in your search box.

In the above program, namespace variable value is initialized as netapp. For the NetApp Device, the namespace for the SMI-S provider is root/ontap. For your information ONTAP is the operating system name for the NetApp device. 
Read more »

Torque E3 Flash File Firmware

This flash file is for Torque E3, this phone has a SPD6531 chipset. You can use this flash file in GPGDragon or Volcano. I have not tried the file in other box as I do not have it besides GPGDragon or Volcano Box.

When you write or flash the file in your phone, it will ask for a password you can read the password in Volcano or GPG Dragon also.

Or you can try this password
Password1: 5624


You can download the file here (click on download ICON)

Read more »