avr

19

Posted by : admin | On : 19 avril 2012

image

image

image

avr

19

Posted by : admin | On : 19 avril 2012

image

image

image

image

image

image

image

image

avr

19

Posted by : admin | On : 19 avril 2012

image

image

avr

19

Posted by : admin | On : 19 avril 2012

 

week end Ski 2012 Sungard

image

image

image

image

image

avr

04

Posted by : admin | On : 4 avril 2012

http://www.marmiton.org/recettes/recette_cookies-tout-chocolat_56794.aspx

mar

11

Posted by : admin | On : 11 mars 2012

http://www.marmiton.org/recettes/recette_blanquette-de-veau-de-la-baronne_25395.aspx

jan

10

Posted by : admin | On : 10 janvier 2012

Rss Reader

Bellow a Simple code about how to make a simple Rss Reader handle by SAX handler.



package mapping.rss;

public class Item {
	private String title ;
	private String description;
	private String link;
	private String pubDate;
	private String source;
	private String mediaContent;
	private String mediaText;
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}
	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the link
	 */
	public String getLink() {
		return link;
	}
	/**
	 * @param link the link to set
	 */
	public void setLink(String link) {
		this.link = link;
	}
	/**
	 * @return the pubDate
	 */
	public String getPubDate() {
		return pubDate;
	}
	/**
	 * @param pubDate the pubDate to set
	 */
	public void setPubDate(String pubDate) {
		this.pubDate = pubDate;
	}
	/**
	 * @return the source
	 */
	public String getSource() {
		return source;
	}
	/**
	 * @param source the source to set
	 */
	public void setSource(String source) {
		this.source = source;
	}
	/**
	 * @return the mediaContent
	 */
	public String getMediaContent() {
		return mediaContent;
	}
	/**
	 * @param mediaContent the mediaContent to set
	 */
	public void setMediaContent(String mediaContent) {
		this.mediaContent = mediaContent;
	}
	/**
	 * @return the mediaText
	 */
	public String getMediaText() {
		return mediaText;
	}
	/**
	 * @param mediaText the mediaText to set
	 */
	public void setMediaText(String mediaText) {
		this.mediaText = mediaText;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Item [title=");
		builder.append(title);
		builder.append(", description=");
		builder.append(description);
		builder.append(", link=");
		builder.append(link);
		builder.append(", pubDate=");
		builder.append(pubDate);
		builder.append(", source=");
		builder.append(source);
		builder.append(", mediaContent=");
		builder.append(mediaContent);
		builder.append(", mediaText=");
		builder.append(mediaText);
		builder.append("]");
		return builder.toString();
	}

}

package xml;

import java.util.ArrayList;
import java.util.List;

import mapping.rss.Item;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class SearchItemRssHandler extends DefaultHandler {
	private final static String CHANNEL="channel";
	private final static String ITEM="item";
	private final static String TITLE="title";
	private final static String LINK="link";
	private final static String DESCRIPTION="description";
	private final static String SOURCE="source";
	private final static String PUBDATE="PUBDATE";

	private boolean bfChannel = false;
	private boolean bfItem = false;
	private boolean bfTitle = false;
	private boolean bflink = false ;
	private boolean bfDescription = false ;
	private boolean bfSource = false ;
	private boolean bfPubdate = false; 

	private Item item ;
	private List<Item> items ;
	public void startElement(String uri, String localName,String qName,
			Attributes attributes) throws SAXException {
		if(qName.equalsIgnoreCase(CHANNEL)){
			items = new ArrayList<Item>();
			bfChannel = true;
		}
		if(qName.equalsIgnoreCase(ITEM)){
			item = new Item();
			bfItem = true ;
		}
		if(qName.equalsIgnoreCase(TITLE)){
			bfTitle = true ;
		}
		if(qName.equalsIgnoreCase(LINK)){
			bflink = true ;
		}
		if(qName.equalsIgnoreCase(PUBDATE)){
			bfPubdate = true ;
		}
		if(qName.equalsIgnoreCase(SOURCE)){
			bfSource = true ;
		}
		if(qName.equalsIgnoreCase(DESCRIPTION)){
			bfDescription = true ;
		}

	}
	public void endElement(String uri, String localName,
			String qName) throws SAXException {
		if(qName.equalsIgnoreCase(ITEM)){
			items.add(item);
			bfItem = false;
		}
		if(qName.equalsIgnoreCase(CHANNEL)){
			setItems(items);
			bfChannel = false ;
		}
	}
	public void characters(char ch[], int start, int length) throws SAXException {
		String resu= new String(ch, start, length);
		if(bfItem){
			bfItem = false;
		}
		if(bfDescription){
			if(item!=null)
			item.setDescription(resu);
			bfDescription = false;
		}
		if(bfTitle){
			if(item!=null)
			item.setTitle(resu);
			bfTitle = false;
		}
		if(bflink){
			if(item!=null)
			item.setLink(resu);
			bflink = false ;
		}
		if(bfPubdate){
			if(item!=null)
			item.setPubDate(resu);
			bfPubdate = false;
		}
		if(bfSource){
			if(item!=null)
			item.setSource(resu);
		}
	}
	/**
	 * @return the items
	 */
	public List<Item> getItems() {
		return items;
	}
	/**
	 * @param items the items to set
	 */
	public void setItems(List<Item> items) {
		this.items = items;
	}
}

///TEST Main 

package xml.test;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.List;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import mapping.rss.Item;

import org.xml.sax.InputSource;

import xml.SearchItemRssHandler;

public class ReadRssXmlFile {
	public static void main(String argv[]) {
		try {
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser saxParser = factory.newSAXParser();

			File file = new File("C:\\workspace\src\\rss-test-fr.xml");
			InputStream inputStream= new FileInputStream(file);
			Reader reader = new InputStreamReader(inputStream,"UTF-8");

			InputSource is = new InputSource(reader);
			is.setEncoding("UTF-8");

			SearchItemRssHandler handler = new SearchItemRssHandler();
			saxParser.parse(is, handler);
			List<Item> items  = handler.getItems();
			for (Item item : items) {
				System.out.println(item);
			}

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

jan

09

Posted by : admin | On : 9 janvier 2012

Android developper doc :

http://developer.android.com/reference/android/widget/AutoCompleteTextView.html

Simple example :

http://www.botskool.com/geeks/how-create-auto-complete-textbox-android

Cook Book

http://androidcookbook.com/ViewTOC.seam

Run autocomplete android

http://stackoverflow.com/questions/7596508/autocomplete-data-retrived-via-http-request-not-hardcded-when-user-type-in-tex

with filter interface

http://stackoverflow.com/questions/8653260/autocomplete-in-android-not-working-with-dynamic-data

http://www.vingtseptpointsept.fr/2011/08/20/bricolons-un-peu-avec-idref/

1) Create below class in your activity

private class CostomTextWatcher implements TextWatcher {

@Override
public void afterTextChanged(Editable s) {
}

@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(s.length() > 0) {
//Make HTTP connection and retrives autocomplete strings from webservice
}

}
}

2) set this above class to edittext using below way

etSearch.addTextChangedListener(new CostomTextWatcher());

You have to make http connection using Background Thread best is AsyncTask

 

 

 
Edit Text recherche dynamique

http://code.google.com/p/android-threshold-edittext/

Autre exemple

http://code.google.com/p/androidsearchexample/downloads/list

Search Suggestion On android
Exemple synthétique :

http://matthias.jimdo.com/blog/

Exemple pratique complet:

http://weblog.plexobject.com/?p=1689

explication globale

http://developer.android.com/guide/topics/search/search-dialog.html

Exemple de recherche Edit Text dynamique

package com.MobileAnarchy.Android.ThresholdEditText;

import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.TextView;

public class ThresholdEditTextActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

final TextView standardInput = (TextView)findViewById(R.id.TextViewStandardTextChange);
final TextView threasholdInput = (TextView)findViewById(R.id.TextViewThreasholdTextChange);

// Get the EditText reference
ThresholdEditText editText = (ThresholdEditText)findViewById(R.id.EditTextInput);

// Subscribe to the standard TextChanged events
editText.addTextChangedListener(new TextWatcher() {

@Override
public void afterTextChanged(Editable arg0) {
}

@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
}

@Override
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
standardInput.setText(arg0);
}

});

// You can manually set the threshold value (default is 500ms)
editText.setThreshold(1000);

// Subscribe to the OnTresholdTextChanged event
editText.setOnThresholdTextChanged(new ThresholdTextChanged() {

@Override
public void onThersholdTextChanged(Editable text) {
Log.d(« Test », « Threshold text changed event was called –  » + text.toString());
threasholdInput.setText(text);
}

});

}
}

package com.MobileAnarchy.Android.ThresholdEditText;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.widget.EditText;

public class ThresholdEditText extends EditText {

// =========================================
// Private members
// =========================================

private int threshold;
private ThresholdTextChanged thresholdTextChanged;
private Handler handler;
private Runnable invoker;
private boolean disableThresholdOnEmptyInput;

// =========================================
// Constructors
// =========================================

public ThresholdEditText(Context context) {
super(context);
initAttributes(null);
init();
}

public ThresholdEditText (Context context, AttributeSet attrs) {
super(context, attrs);
initAttributes(attrs);
init();
}

// =========================================
// Public properties
// =========================================

/**
* Get the current threshold value
*/
public int getThreshold() {
return threshold;
}

/**
* Set the threshold value (in milliseconds)
* @param threshold Threshold value
*/
public void setThreshold(int threshold) {
this.threshold = threshold;
}

/**
* @return True = the callback will fire immediately when the content of the EditText is emptied
* False = The threshold will be used even on empty input
*/
public boolean isDisableThresholdOnEmptyInput() {
return disableThresholdOnEmptyInput;
}

/**
* @param disableThresholdOnEmptyInput Set to true if you want the callback to fire immediately when the content of the EditText is emptied
*/
public void setDisableThresholdOnEmptyInput(boolean disableThresholdOnEmptyInput) {
this.disableThresholdOnEmptyInput = disableThresholdOnEmptyInput;
}

/**
* Set the callback to the OnThresholdTextChanged event
* @param listener
*/
public void setOnThresholdTextChanged(ThresholdTextChanged listener) {
this.thresholdTextChanged = listener;
}

// =========================================
// Private / Protected methods
// =========================================

/**
* Load properties values from xml layout
*/
private void initAttributes(AttributeSet attrs) {
if (attrs != null) {
String namespace= »http://schemas.android.com/apk/res/com.MobileAnarchy.ThresholdEditText »;

// Load values to local members
this.threshold = attrs.getAttributeIntValue(namespace, « threshold », 500);;
this.disableThresholdOnEmptyInput = attrs.getAttributeBooleanValue(namespace, « disableThresholdOnEmptyInput », true);;
}
else {
// Default threshold value is 0.5 seconds
threshold = 500;

// Default behaviour on emptied text – no threshold
disableThresholdOnEmptyInput = true;
}
}

/**
* Initialize the private members with default values
*/
private void init() {

handler = new Handler();

invoker = new Runnable() {

@Override
public void run() {
invokeCallback();
}

};

this.addTextChangedListener(new TextWatcher() {

@Override
public void afterTextChanged(Editable s) { }

@Override
public void beforeTextChanged(CharSequence s, int start, int count,    int after) { }

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {

// Remove any existing pending callbacks
handler.removeCallbacks(invoker);

if (s.length() == 0 && disableThresholdOnEmptyInput)
{
// The text is empty, so invoke the callback immediately
invoker.run();
}
else {
// Post a new delayed callback
handler.postDelayed(invoker, threshold);
}
}

});
}

/**
* Invoking the callback on the listener provided (if provided)
*/
private void invokeCallback() {
if (thresholdTextChanged != null) {
thresholdTextChanged.onThersholdTextChanged(this.getText());
}
}

}

package com.MobileAnarchy.Android.ThresholdEditText;

import android.text.Editable;

public interface ThresholdTextChanged {
void onThersholdTextChanged(Editable text);
}

déc

21

Posted by : admin | On : 21 décembre 2011

image

image

image

image

image

image

image

image

image

image

image

Chamonix
Les grands montets
Tours
Les houches….

déc

05

Posted by : admin | On : 5 décembre 2011

003-logotype-web

Riche d’environ 10 millions de références bibliographiques (monographies, thèses, publications en série et autres types de documents), le catalogue Sudoc propose en outre la / les localisation(s) des documents décrits par les bibliothèques des universités françaises et autres établissements de l’enseignement supérieur et de la recherche participant au réseau du Sudoc.  S’y ajoute le recensement des collections de publications en série d’environ 2400 autres centres documentaires français.

Le catalogue Sudoc, pour quoi faire ?

  • effectuer des recherches bibliographiques ;
  • savoir dans quelles bibliothèques se trouvent les documents ;
  • consulter les documents en s’adressant aux bibliothèques qui les détiennent ;
  • consulter les coordonnées des bibliothèques du réseau Sudoc dans le « Répertoire des Bibliothèques » accessible en page d’accueil du catalogue ;
  • accéder directement à certains documents disponibles sur le Web dans leur version électronique en cliquant sur la zone cliquable située dans la notice bibliographique ou directement sur l’icône  icône lein vers la version électronique d'un document vers le document en ligne dans la liste des résultats.
  • effectuer des demandes de Prêt-Entre-Bibliothèques (PEB) auprès de votre bibliothèque de rattachement (universitaire ou de recherche)

Les données du catalogue Sudoc sont également accessibles via le Catalogue collectif de France (CCFr) qui regroupe  également les catalogues de la BnF et des bibliothèques municipales choisies pour leurs fonds anciens et locaux (BMR).

Le projet API Sudoc est avant tout une méthode, qui vise à développer de nouveaux services autour des données Sudoc, en s’affranchissant des contraintes imposées par les progiciels historiques du catalogue. C’est ainsi que le projet API Sudoc a permis l’existence d’IdRef et de SELF Sudoc. Dans cette logique d’extension et de démocratisation du web Sudoc fourni également deux micro web services WHERE et BIBLIO.

C’est deux webservices nous permettent de retrouver l’emplacement d’un ouvrage  en regard au ppn (identifiant notice fourni) .

à Partir de là, si vous avez bien lu la documentation et compris comment interroger le service distant il ne vous reste plus qu’à gérer le format de retour du service fourni par Ideref / sudoc (voir fichier Xml ci dessous) . Il faut pour cela utiliser les services REST fourni par sudoc (via la technologie Apache soldr)

 

  • Resources

http://www.abes.fr/Sudoc/Le-catalogue-Sudoc

http://fil.abes.fr/tag/web-services/

http://documentation.abes.fr/aideidref/developpeur/APISudocDev.pdf

http://www.idref.fr/Sru/Solr?q=persname_t:boulnois%20olivier&sort=score%20desc&version=2.2&start=0&rows=30&indent=on&fl=id,ppn_z,recordtype_z,affcourt_z

  • La version Web :

http://www.idref.fr/autorites/autorites.html

 

Les données issu de ce service sont écrites sous format XML

exemple de fichier : ici nous cherchons les noms correspondant « Boulnois »

 

 

<?xml version="1.0" encoding="UTF-8"?>
<response>

	<lst name="responseHeader">
		<int name="status">0</int>
		<int name="QTime">0</int>
		<lst name="params">
			<str name="sort">score desc</str>
			<str name="version">2.2</str>
			<str name="fl">id,ppn_z,recordtype_z,affcourt_z</str>
			<str name="indent">on</str>
			<str name="rows">30</str>
			<str name="start">0</str>
			<str name="q">persname_t:boulnois olivier</str>
		</lst>
	</lst>
	<result name="response" numFound="14" start="0">
		<doc>
			<str name="affcourt_z">Boulnois, Francis</str>
			<str name="id">1595496</str>
			<str name="ppn_z">111178592</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Philippe</str>
			<str name="id">1939955</str>
			<str name="ppn_z">131009176</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Elisabeth</str>
			<str name="id">2077186</str>
			<str name="ppn_z">139090266</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Willy</str>
			<str name="id">2103576</str>
			<str name="ppn_z">14036403X</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Jean</str>
			<str name="id">218901</str>
			<str name="ppn_z">029881927</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Arnaud</str>
			<str name="id">756495</str>
			<str name="ppn_z">061403563</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois-Lagache, Catherine</str>
			<str name="id">1490499</str>
			<str name="ppn_z">099120305</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Lucette (1931-2009)</str>
			<str name="id">20996</str>
			<str name="ppn_z">026744244</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Jean-Bernard</str>
			<str name="id">1835415</str>
			<str name="ppn_z">124341241</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Anne (1984-....)</str>
			<str name="id">2046358</str>
			<str name="ppn_z">137178980</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Olivier (1961-....)</str>
			<str name="id">193892</str>
			<str name="ppn_z">029405882</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Sohet-Boulnois, Suzanne</str>
			<str name="id">1578337</str>
			<str name="ppn_z">110490509</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Boulnois, Marie-Odile (1962-....)</str>
			<str name="id">261144</str>
			<str name="ppn_z">030679850</str>
			<str name="recordtype_z">a</str>
		</doc>
		<doc>
			<str name="affcourt_z">Hubert, Michèle (1946-....)</str>
			<str name="id">1098651</str>
			<str name="ppn_z">079264514</str>
			<str name="recordtype_z">a</str>
		</doc>
	</result>
</response>