You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-commits@incubator.apache.org by su...@apache.org on 2011/06/14 15:31:31 UTC

svn commit: r1135648 - in /incubator/photark/trunk: photark-face-recognition/src/main/java/org/apache/photark/face/services/ photark-face-recognition/src/main/resources/META-INF/ photark-ui/src/main/webapp/js/ photark-webapp/ photark-webapp/src/main/we...

Author: subash
Date: Tue Jun 14 15:31:30 2011
New Revision: 1135648

URL: http://svn.apache.org/viewvc?rev=1135648&view=rev
Log:
created SCA component for FaceRecognitionService and added proper comments to all classes

Added:
    incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/
    incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml   (contents, props changed)
      - copied, changed from r1130585, incubator/photark/trunk/photark-filesystem/src/main/resources/sca-contribution.xml
Modified:
    incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionService.java
    incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionServiceImpl.java
    incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js
    incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js
    incubator/photark/trunk/photark-webapp/pom.xml
    incubator/photark/trunk/photark-webapp/src/main/webapp/WEB-INF/web.composite

Modified: incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionService.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionService.java?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionService.java (original)
+++ incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionService.java Tue Jun 14 15:31:30 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.photark.face.services;
 
-import com.github.mhendred.face4j.DefaultFaceClient;
 import com.github.mhendred.face4j.exception.FaceClientException;
 import com.github.mhendred.face4j.exception.FaceServerException;
 import com.github.mhendred.face4j.model.*;
@@ -26,63 +25,249 @@ import com.github.mhendred.face4j.respon
 import com.github.mhendred.face4j.response.LimitsResponse;
 import com.github.mhendred.face4j.response.TrainResponse;
 import com.github.mhendred.face4j.response.UsersResponse;
+import org.oasisopen.sca.annotation.Remotable;
 
 import java.io.File;
 import java.util.List;
 
+@Remotable
 public interface FaceRecognitionService {
 
+    /**
+     * Removes old saved tags on a Photo
+     *
+     * @param tids Tag ids which should be removed. Can pass multiple tag ids once by comma delimiting.
+     * @return java.util.List of RemovedTag instances
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<RemovedTag> removeTags(String tids) throws FaceClientException, FaceServerException;
+
+    /**
+     * Trains the face index with a given set if uids(can be private namespace or a public namespace)
+     * i.e friends@Facebook.com
+     *
+     * @param uids Comma separated uids which can be recognized later.
+     * @return TrainResponse
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public TrainResponse train(String uids) throws FaceClientException, FaceServerException;
+
+    /** Adds a manual tag for a Photo.But manual tags are not used to train the system. They are used for the purpose
+     * of adding face tags for the Photos which were not detected by your program.
+     *
+     * @param url
+     * @param x
+     * @param y
+     * @param width
+     * @param height
+     * @param uid
+     * @param label
+     * @param taggerId
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+
+    public void addTag(String url, float x, float y, int width, int height, String uid, String label, String taggerId) throws FaceClientException, FaceServerException;
+
+    /** Gives saved tags in one or more photos or for the specified User IDs.
+     *
+     * @param pids Photo ID
+     * @param urls Comma delimited urls.
+     * @param uids Comma delimited User IDs
+     * @param order Default value is 'recent' which specifies the latest tags. Also value 'random' indicates
+     *        to select tags randomly.
+     * @param filter Filter results
+     *
+     * @param together Returns photos which are only contains all uids together (provided that you give multiple User IDs) 
+     *        appears together in the photos, if you are
+     * @param limit Max no of tags to be returned. Default value is 5.
+     * @return Photos which are tagged in the given uids
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Photo> getTagsWithPIDs(String pids, String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException;
+
+
+    /**
+     * Same as {@getTags} except this can only pass uids for get tags unlike both pids and uids in earlier case
+     * @param urls
+     * @param uids
+     * @param order
+     * @param filter
+     * @param together
+     * @param limit
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Photo> getTags(String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException ;
+    
+
+    /**
+     * Saves tags for a given user with a label
+     * @param tids Set of tag ids which are associated with the given User ID
+     * @param uid User Id in to which you should add one or more tags
+     * @param label For readability. Generally we use user's First name
+     * @return SavedTag
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<SavedTag> saveTags(String tids, String uid, String label) throws FaceClientException, FaceServerException;
+
+    /**
+     *  Does recognize whether the given image contains any of given users(by ID).
+     * @param imageFile Image file which you gonna to identify whether your friends are there.
+     * @param uids User IDs whom should be get recognized
+     * @return  Photo
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public Photo recognizeFromFile(File imageFile, String uids) throws FaceClientException, FaceServerException;
+
+    /**
+     * Recognizes same as {@recognizeFromFile} except, this time the domain can be given as a url itself.
+     * @param urls
+     * @param uids
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Photo> recognizeFromUrls(String urls, String uids) throws FaceClientException, FaceServerException ;
+
+    /**  Gives tags of the detected faces of the given photo with multiple details of the Photo
+     *
+     * @param imageFile   Image to be detected
+     * @return Photo
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public Photo detectFromFile(File imageFile) throws FaceClientException, FaceServerException;
+
+    /**
+     * Detection happens same as {@detectFromFile} except this time its from urls
+     * @param urls
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Photo> detectFromUrls(String urls) throws FaceClientException, FaceServerException;
+
+    /**
+     * Gives the status of the given User IDs from the training set.
+     * @param uids
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<UserStatus> status(String uids) throws FaceClientException, FaceServerException;
+
+    /**
+     *  Gives Facebook tags for one or more specified USer IDs
+     * @param uids
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Photo> facebookGet(String uids) throws FaceClientException, FaceServerException;
+
+    /** Detects and group and optionally tries to recognize faces of the given uids in the image
+     *
+     * @param imageFile
+     * @param uids
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public GroupResponse groupFromFile(File imageFile, String uids) throws FaceClientException, FaceServerException;
+
+    /**
+     *  Grouping happens same as {@groupFromFile} except this time its from urls
+     * @param urls
+     * @param uids
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public GroupResponse groupFromUrls(String urls, String uids) throws FaceClientException, FaceServerException ;
+
+    /**
+     * Gives a list of users of the given namespace
+     * @param namespaces
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public UsersResponse users(String namespaces) throws FaceClientException, FaceServerException;
+
+    /**
+     *  Gives usage stats
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public LimitsResponse getLimits() throws FaceClientException, FaceServerException;
+
+    /**
+     *  Gives the list of all namspaces you have registered in your face.com API key
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public List<Namespace> getAllNamespaces() throws FaceClientException, FaceServerException;
+
+    /**
+     *  Gives stats of the given namespace by {@link Namespace}
+     * @param namespace
+     * @return
+     * @throws FaceClientException
+     * @throws FaceServerException
+     */
+    public Namespace getNamespace(String namespace) throws FaceClientException, FaceServerException;
+
+    /**
+     * Sets the Facebook credentials for a particular by specifying his FB uid and his access token.
+     * @param fbUserId
+     * @param oauthToken
+     */
+    public void setFacebookOauth2(String fbUserId, String oauthToken);
+
+    /**
+     * Sets the Twitter credentials for a particular by specifying his TW uid and his access token and secret.
+     * @param oauthUser
+     * @param oauthSecret
+     * @param oauthToken
+     */
+    public void setTwitterOauth(String oauthUser, String oauthSecret, String oauthToken);
+
+    /**
+     *  Clears the existing Facebook credentials.
+     */
+    public void clearFacebookCreds();
+
+    /**
+     *   Clears existing Twitter credentials.
+     */
+    public void clearTwitterCreds();
+
+    /**
+     *  Changes the current face detector's work mode from default position(Normal) to Aggressive.
+     * @param isAggressive
+     */
+    public void setAggressive(boolean isAggressive);
+
+    /**
+     * Check whether face detector of your application is in the mode "Aggressive"
+     * @return
+     */
+    public boolean isAggressive();
+
+    /**
+     *  create a new DafaultFaceClient by the specified face.com registered api key and secret.
+     * @param apiKey
+     * @param apiSecret
+     */
+    public void createNewDefaultFaceClient(String apiKey, String apiSecret);
 
-       public List<RemovedTag> removeTags(String tids) throws FaceClientException, FaceServerException;
-
-       public TrainResponse train(String uids) throws FaceClientException, FaceServerException ;
-
-       public void addTag(String url, float x, float y, int width, int height, String uid, String label, String taggerId) throws FaceClientException, FaceServerException ;
-
-       public List<Photo> getTags(String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException ;
-
-       public List<Photo> getTags(String pids, String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException ;
-
-       public List<SavedTag> saveTags(String tids, String uid, String label) throws FaceClientException, FaceServerException;
-
-       public Photo recognize(File imageFile, String uids) throws FaceClientException, FaceServerException;
-
-       public List<Photo> recognize(String urls, String uids) throws FaceClientException, FaceServerException ;
-
-       public Photo detect(File imageFile) throws FaceClientException, FaceServerException ;
-
-       public List<Photo> detect(String urls) throws FaceClientException, FaceServerException;
-
-       public List<UserStatus> status(String uids) throws FaceClientException, FaceServerException ;
-
-       public List<Photo> facebookGet(String uids) throws FaceClientException, FaceServerException ;
-
-       public GroupResponse group(String urls, String uids) throws FaceClientException, FaceServerException ;
-
-       public GroupResponse group(File imageFile, String uids) throws FaceClientException, FaceServerException ;
-
-       public UsersResponse users(String namespaces) throws FaceClientException, FaceServerException;
-
-       public LimitsResponse getLimits() throws FaceClientException, FaceServerException ;
-
-       public List<Namespace> namespaces() throws FaceClientException, FaceServerException ;
-
-       public Namespace getNamespace(String namespace) throws FaceClientException, FaceServerException ;
-
-       public void setFacebookOauth2(String fbUserId, String oauthToken) ;
-
-       public void setTwitterOauth(String oauthUser, String oauthSecret, String oauthToken) ;
-
-       public void clearFacebookCreds();
-
-       public void clearTwitterCreds() ;
-
-       public void setAggressive(boolean isAggressive) ;
-
-       public boolean isAggressive() ;
-
-       public void setFaceDotComAPIKeySecret(String apiKey,String apiSecret);
-
-       public void createNewDefaultFaceClient(String apiKey,String apiSecret);
-
-    }
+}

Modified: incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionServiceImpl.java?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionServiceImpl.java (original)
+++ incubator/photark/trunk/photark-face-recognition/src/main/java/org/apache/photark/face/services/FaceRecognitionServiceImpl.java Tue Jun 14 15:31:30 2011
@@ -26,7 +26,6 @@ import com.github.mhendred.face4j.respon
 import com.github.mhendred.face4j.response.LimitsResponse;
 import com.github.mhendred.face4j.response.TrainResponse;
 import com.github.mhendred.face4j.response.UsersResponse;
-import org.apache.photark.jcr.JCRRepositoryManager;
 import org.oasisopen.sca.annotation.Init;
 import org.oasisopen.sca.annotation.Reference;
 import org.oasisopen.sca.annotation.Remotable;
@@ -35,123 +34,184 @@ import org.oasisopen.sca.annotation.Scop
 import java.io.File;
 import java.util.List;
 
-@Remotable
 @Scope("COMPOSITE")
 public class FaceRecognitionServiceImpl implements FaceRecognitionService {
 
     private DefaultFaceClient defaultFaceClient;
-    private String apiKey = "";
-    private String apiSecret = "";
-
-    @Init
-    public void init() {
-        defaultFaceClient = new DefaultFaceClient(apiKey, apiSecret);
-
-    }
 
+    /**
+     * @see {@link FaceRecognitionService#removeTags(String)}
+     */
     public List<RemovedTag> removeTags(String tids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.removeTags(tids);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#train(String)}
+     */
     public TrainResponse train(String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.train(uids);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#addTag(String,float,float,int,int,String,String,String)}
+     */
     public void addTag(String url, float x, float y, int width, int height, String uid, String label, String taggerId) throws FaceClientException, FaceServerException {
         defaultFaceClient.addTag(url, x, y, width, height, uid, label, taggerId);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#getTags(String,String,String,String,boolean,int)}
+     */
     public List<Photo> getTags(String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException {
         return defaultFaceClient.getTags(urls, uids, order, filter, together, limit);
     }
 
-    public List<Photo> getTags(String pids, String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#getTagsWithPIDs(String,String,String,String,String,boolean,int)}
+     */
+    public List<Photo> getTagsWithPIDs(String pids, String urls, String uids, String order, String filter, boolean together, int limit) throws FaceClientException, FaceServerException {
         return defaultFaceClient.getTags(pids, urls, uids, order, filter, together, limit);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#saveTags(String,String,String)}
+     */
     public List<SavedTag> saveTags(String tids, String uid, String label) throws FaceClientException, FaceServerException {
         return defaultFaceClient.saveTags(tids, uid, label);
     }
 
-    public Photo recognize(File imageFile, String uids) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#recognizeFromFile(File,String)}
+     */
+    public Photo recognizeFromFile(File imageFile, String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.recognize(imageFile, uids);
     }
 
-    public List<Photo> recognize(String urls, String uids) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#recognizeFromUrls(String,String)}
+     */
+    public List<Photo> recognizeFromUrls(String urls, String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.recognize(urls, uids);
     }
 
-    public Photo detect(File imageFile) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#detectFromFile(File)}
+     */
+    public Photo detectFromFile(File imageFile) throws FaceClientException, FaceServerException {
         return defaultFaceClient.detect(imageFile);
     }
 
-    public List<Photo> detect(String urls) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#detectFromUrls(String)}
+     */
+    public List<Photo> detectFromUrls(String urls) throws FaceClientException, FaceServerException {
         return defaultFaceClient.detect(urls);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#status(String)}
+     */
     public List<UserStatus> status(String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.status(uids);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#facebookGet(String)}
+     */
     public List<Photo> facebookGet(String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.facebookGet(uids);
     }
 
-    public GroupResponse group(String urls, String uids) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#groupFromUrls(String,String)}
+     */
+    public GroupResponse groupFromUrls(String urls, String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.group(urls, uids);
     }
 
-    public GroupResponse group(File imageFile, String uids) throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#groupFromFile(File,String)}
+     */
+    public GroupResponse groupFromFile(File imageFile, String uids) throws FaceClientException, FaceServerException {
         return defaultFaceClient.group(imageFile, uids);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#users(String)}
+     */
     public UsersResponse users(String namespaces) throws FaceClientException, FaceServerException {
         return defaultFaceClient.users(namespaces);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#getLimits()}
+     */
     public LimitsResponse getLimits() throws FaceClientException, FaceServerException {
         return defaultFaceClient.getLimits();
     }
 
-    public List<Namespace> namespaces() throws FaceClientException, FaceServerException {
+    /**
+     * @see {@link FaceRecognitionService#getAllNamespaces()}
+     */
+    public List<Namespace> getAllNamespaces() throws FaceClientException, FaceServerException {
         return defaultFaceClient.namespaces();
     }
 
+    /**
+     * @see {@link FaceRecognitionService#getNamespace(String)}
+     */
     public Namespace getNamespace(String namespace) throws FaceClientException, FaceServerException {
         return defaultFaceClient.getNamespace(namespace);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#setFacebookOauth2(String,String)}
+     */
     public void setFacebookOauth2(String fbUserId, String oauthToken) {
         defaultFaceClient.setFacebookOauth2(fbUserId, oauthToken);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#setTwitterOauth(String,String,String)}
+     */
     public void setTwitterOauth(String oauthUser, String oauthSecret, String oauthToken) {
         defaultFaceClient.setTwitterOauth(oauthUser, oauthSecret, oauthToken);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#clearFacebookCreds()}
+     */
     public void clearFacebookCreds() {
         defaultFaceClient.clearFacebookCreds();
     }
 
+    /**
+     * @see {@link FaceRecognitionService#clearTwitterCreds()}
+     */
     public void clearTwitterCreds() {
         defaultFaceClient.clearTwitterCreds();
     }
 
+    /**
+     * @see {@link FaceRecognitionService#setAggressive(boolean)}
+     */
     public void setAggressive(boolean isAggressive) {
         defaultFaceClient.setAggressive(isAggressive);
     }
 
+    /**
+     * @see {@link FaceRecognitionService#isAggressive()}
+     */
     public boolean isAggressive() {
         return defaultFaceClient.isAggressive();
     }
 
-    public void setFaceDotComAPIKeySecret(String apiKey, String apiSecret) {
-        this.apiKey = apiKey;
-        this.apiSecret = apiSecret;
-    }
-
+    /**
+     * @see {@link FaceRecognitionService#createNewDefaultFaceClient(String,String)}
+     */
     public void createNewDefaultFaceClient(String apiKey, String apiSecret) {
-        defaultFaceClient = new DefaultFaceClient(apiKey,apiSecret);
+        defaultFaceClient = new DefaultFaceClient(apiKey, apiSecret);
     }
 
 }

Copied: incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml (from r1130585, incubator/photark/trunk/photark-filesystem/src/main/resources/sca-contribution.xml)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml?p2=incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml&p1=incubator/photark/trunk/photark-filesystem/src/main/resources/sca-contribution.xml&r1=1130585&r2=1135648&rev=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-filesystem/src/main/resources/sca-contribution.xml (original)
+++ incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml Tue Jun 14 15:31:30 2011
@@ -19,5 +19,9 @@
 -->
 <contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
               xmlns:photark="http://org.apache.photoark">
-   <export.java package="org.apache.photark.filesystem.services"/>
+   <export.java package="org.apache.photark.face.services"/>
+   <export.java package="com.github.mhendred.face4j.exception"/>
+   <export.java package="com.github.mhendred.face4j.model"/>
+   <export.java package="om.github.mhendred.face4j.response"/>
+
 </contribution>

Propchange: incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/photark/trunk/photark-face-recognition/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js Tue Jun 14 15:31:30 2011
@@ -28,6 +28,7 @@ if (! photark.constants) {
 photark.constants.contextRoot = "/photark/";
 photark.constants.adminContextRoot = "/photark/admin/";
 
+photark.constants.FaceRecognitionService = photark.constants.contextRoot + "FaceRecognitionService?smd";
 photark.constants.RemoteAlbumSubscription = photark.constants.contextRoot + "RemoteAlbumSubscriptionManager?smd";
 photark.constants.GalleryServiceEndpoint = photark.constants.contextRoot + "GalleryService?smd";
 photark.constants.RemoteGalleryServiceEndpoint = photark.constants.contextRoot + "JCRRemoteGallery?smd";

Modified: incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js Tue Jun 14 15:31:30 2011
@@ -33,6 +33,7 @@ var show_slide_slow_on  = new Image(31,3
 var gallery;
 var remoteGallery;
 var searchService;
+var faceService;
 var galleryName;
 
 var galleryAlbums;
@@ -56,6 +57,9 @@ var SECURITY_TOKEN;
 var permissions = new Array();
 var albumImageToBeLoaded = null;
 
+var FACE_API_KEY = "";
+var FACE_API_SECRET = "";
+
 dojo.addOnLoad(function() {
     dojo.require("dojo._base.xhr");
     dojo.require("dojo.rpc.JsonService");
@@ -91,6 +95,8 @@ function initServices(){
   	searchService = new dojo.rpc.JsonService( photark.constants.SearchServiceEndpoint );
     gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
     remoteGallery = new dojo.rpc.JsonService(photark.constants.RemoteGalleryServiceEndpoint);
+    faceService = new dojo.rpc.JsonService(photark.constants.FaceRecognitionService);
+//  faceService.createNewDefaultFaceClient(FACE_API_KEY,FACE_API_SECRET).addCallback(face_callback);
 
 }
 
@@ -271,6 +277,17 @@ function addTag() {
 	 
 }
 
+function face_callback(items, exception) {
+    if(exception) {
+       // alert(exception.msg);
+        displayGallery();
+         logout();
+      //  return;
+    }
+
+}
+
+
 function initializeRemoteGallery() {
     var table=document.getElementById('remoteTableGallery');
     var lastRow = table.rows.length;

Modified: incubator/photark/trunk/photark-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-webapp/pom.xml?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-webapp/pom.xml (original)
+++ incubator/photark/trunk/photark-webapp/pom.xml Tue Jun 14 15:31:30 2011
@@ -69,6 +69,12 @@
 			<type>war</type>
 		</dependency>
 
+        <dependency>
+			<groupId>org.apache.photark</groupId>
+			<artifactId>photark-face-recognition</artifactId>
+			<version>1.0-incubating-SNAPSHOT</version>
+		</dependency>
+
 		<dependency>
 			<groupId>org.apache.tuscany.sca</groupId>
 			<artifactId>tuscany-host-webapp</artifactId>

Modified: incubator/photark/trunk/photark-webapp/src/main/webapp/WEB-INF/web.composite
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-webapp/src/main/webapp/WEB-INF/web.composite?rev=1135648&r1=1135647&r2=1135648&view=diff
==============================================================================
--- incubator/photark/trunk/photark-webapp/src/main/webapp/WEB-INF/web.composite (original)
+++ incubator/photark/trunk/photark-webapp/src/main/webapp/WEB-INF/web.composite Tue Jun 14 15:31:30 2011
@@ -167,6 +167,16 @@
    		<reference name="listeners" target="SearchService"/>
    	    <reference name="accessmanager" target="AccessManager"/>
     </component>
+
+    <component name="FaceRecognitionService">
+		<implementation.java class="org.apache.photark.face.services.FaceRecognitionServiceImpl"/>
+
+		<service name="FaceRecognitionService">
+   			<interface.java interface="org.apache.photark.face.services.FaceRecognitionService"/>
+   			<binding.sca name="local"/>
+   			<tuscany:binding.jsonrpc uri="/FaceRecognitionService"/>
+   		</service>
+	</component>
     
 	
 </composite>