Package org.corrib.s3b.sscf.imports

Examples of org.corrib.s3b.sscf.imports.BookmarksImport


      sscfPerson = "mailto:" + sscfPerson;
    BookmarkingSource bookmarkingSource = BookmarkingSource.getBookmarkingSource(bs);
   
    //handle flickr -> get new auth Token
    if(BookmarkingSource.FLICKR.equals(bookmarkingSource)){
      BookmarksImport bi = BookmarksImport.getBookmarksImport(bs,login,password,sscfPerson,SscfAjax.getServiceAddr(request));
     
      //if bi has a different password than the given one
      //it means that the person has already tried importing and is stored in a static map
      //then it need to be removed
      //and new bookmarks import needs to be created for that person
      if(!bi.getPassword().equals(password)){
        BookmarksImport.removeBookmarksImport(bs, login, sscfPerson);
        bi = BookmarksImport.getBookmarksImport(bs,login,password,sscfPerson,SscfAjax.getServiceAddr(request));
      }
      if(!bi.credentialsCheck()){
        String formParams = ((FlickrBookmarksImport)bi).getFlickrLoginFormParams();
        //FlickrCallbackServlet will know that it only has to write credentials to storage
        request.getSession().setAttribute("credentialsOnly", true);
        request.getSession().setAttribute("username", login);
        try {
View Full Code Here


  public String[] importBookmarks(String type,String username,String password,String check,String sscfPersonUri,String serviceAddr)
  {
    String[] result = new String[2];
    if(username!=null)
        {
          BookmarksImport bi = BookmarksImport.getBookmarksImport(type,username,password,sscfPersonUri,serviceAddr);
          //check only the credentials
          if(check!=null&&bi!=null)
          {
            if(bi.credentialsCheck())
            {
              //check if import has been already done
              SscfTagger st = SscfTagger.getSscfTaggerIfExists(bi.getRootUri().toString(), sscfPersonUri, null, null);
              if(st==null)
              {
                System.out.println("Credentials OK");
                  result[0] = TaskStatusInfo.CHECKED.getMessage();
                  return result;
              }
              result[0] = TaskStatusInfo.EXISTS.getMessage();
              return result;
             
            }else if (bi instanceof FlickrBookmarksImport){
              result[0] = TaskStatusInfo.REDIRECTING.getMessage();
              result[1] = ((FlickrBookmarksImport)bi).getFlickrLoginFormParams();
            return result;
            }

          BookmarksImport.removeBookmarksImport(type,username,sscfPersonUri);
          return null;
           
          }
         
          if(bi!=null&&bi.isAlive())
          {
            result[0] = TaskStatusInfo.INPROGRESS.getMessage();
          result[1] = bi.getMessage();
          }
          else if(bi!=null&&!bi.isStarted())
          {
            bi.start();
            result[0] = TaskStatusInfo.STARTED.getMessage();
          }
          else if(bi!=null)
          {
            if(bi.getMessage()!=null)
              result[0] = bi.getMessage();
          if(bi.getRootUri()!=null)
            result[1] = bi.getRootUri().toString();
            BookmarksImport.removeBookmarksImport(type,username,sscfPersonUri);
          }
          //notify synchronization resource loader that resources of user were changed
        ResourcesLoader.setLastChangeDate(username, new Date())
View Full Code Here

       
          //change of credentials requested and returning from flickr
          if(request.getSession().getAttribute("credentialsOnly") != null
              && (Boolean)request.getSession().getAttribute("credentialsOnly") == true){
            request.getSession().setAttribute("credentialsOnly", null);
            BookmarksImport bi = BookmarksImport.getBookmarksImport(BookmarkingSource.FLICKR.getType(), username, frob, viewer, getServiceAddr(request));
            FlickrBookmarksImport fbi = (FlickrBookmarksImport) bi;
            if(fbi.validateUser(frob)){
              try {
            UserCredentials.getInstance().storeCredentials(viewer, BookmarkingSource.FLICKR, fbi.getLogin(), fbi.getPassword());
          } catch (BadCredentialsException e) {
View Full Code Here

   * @return
   */
  protected String[] importBookmarks(String frob, String username,String viewer,
      String serviceAddr) {
   
    BookmarksImport bi;
    String[] result = new String[2];
    if(frob != null && !"".equals(frob)){
     
      bi = BookmarksImport.getBookmarksImport(BookmarkingSource.FLICKR.getType(), username, frob, viewer, serviceAddr);
     
View Full Code Here

TOP

Related Classes of org.corrib.s3b.sscf.imports.BookmarksImport

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.