Package org.apache.roller.util

Examples of org.apache.roller.util.Technorati$Result


        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteURL()!=null && form.getSiteURL().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteURL());
                technoratiTitle = result.getWeblog().getName();
                technoratiFeedUrl = result.getWeblog().getRssurl();
                form.setInboundlinks(result.getWeblog().getInboundlinks());
                form.setInboundblogs(result.getWeblog().getInboundblogs());
            } catch (Exception e) {
View Full Code Here


        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
                        +"technorati.license not found at root of classpath.\n"
                        +"Get license at http://technorati.com/developers/apikey.html\n"
                        +"Put the license string in a file called technorati.license.\n"
                        +"And place that file at the root of Roller's classpath.\n"
                        +"For example, in the /WEB-INF/classes directory.");
                return;
            }
           
            UserManager userManager = RollerFactory.getRoller().getUserManager();
            try {
                int limit = RollerConfig.getIntProperty(
                        "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                log.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getAllSubscriptions();
                while (subs.hasNext()) {
                    PlanetSubscriptionData sub =
                            (PlanetSubscriptionData)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteURL());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here

        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteURL()!=null && form.getSiteURL().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteURL());
                technoratiTitle = result.getWeblog().getName();
                technoratiFeedUrl = result.getWeblog().getRssurl();
                form.setInboundlinks(result.getWeblog().getInboundlinks());
                form.setInboundblogs(result.getWeblog().getInboundblogs());
            } catch (Exception e) {
View Full Code Here

        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
                        +"technorati.license not found at root of classpath.\n"
                        +"Get license at http://technorati.com/developers/apikey.html\n"
                        +"Put the license string in a file called technorati.license.\n"
                        +"And place that file at the root of Roller's classpath.\n"
                        +"For example, in the /WEB-INF/classes directory.");
                return;
            }
           
            UserManager userManager = RollerFactory.getRoller().getUserManager();
            try {
                int limit = RollerConfig.getIntProperty(
                        "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                log.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getAllSubscriptions();
                while (subs.hasNext()) {
                    PlanetSubscriptionData sub =
                            (PlanetSubscriptionData)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteURL());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here

      setFaultCode(fCode);
    }
   
    setFaultString(getMessage());
   
    Result r = this.objectFactory.createResult();
    ErrInfo ei = this.objectFactory.createErrInfo();

    if (errCode != null) {
      ei.setErrCode(errCode);
    }

    ei.setValue(getMessage());

     r.setErrno(errno);

    if (ei != null) {
      r.setErrInfo(ei);
    }

    addResult(r);
  }
View Full Code Here

  {
    if (this.dispReport==null) {
      this.dispReport = this.objectFactory.createDispositionReport();
    }

    Result jaxbResult = this.objectFactory.createResult();
    this.dispReport.getResult().add(jaxbResult);
   
    if (result.getErrInfo() != null) jaxbResult.setErrInfo(result.getErrInfo());
    if (result.getKeyType() != null) jaxbResult.setKeyType(result.getKeyType());
    jaxbResult.setErrno(result.getErrno());
  }
View Full Code Here

            keyResultArr = new Result[resultList.size()];
            resultList.toArray(keyResultArr);
           
            log.debug("After deleting Business. Obtained vector size:" + keyResultArr != null ? keyResultArr.length : 0);
            for (int i = 0; keyResultArr != null && i < keyResultArr.length; i++) {
                Result result = (Result) keyResultArr[i];
                int errno = result.getErrno();
                if (errno == 0) {
                    coll.addAll(keys);
                }
                else {
                    ErrInfo errinfo = result.getErrInfo();
                    DeleteException de = new DeleteException(errinfo.getErrCode() + ":" + errinfo.getValue());
                    bulk.setStatus(JAXRResponse.STATUS_FAILURE);
                    exceptions.add(de);
                }
            }
View Full Code Here

        private DispositionReport getSuccessMessage() {
                DispositionReport r = new DispositionReport();
                r.setGeneric("2.0");
                r.setTruncated(Truncated.FALSE);
                Result x = new Result();
                r.setOperator(getNodeID());
                r.getResult().add(x);
                return r;
        }
View Full Code Here

                List<Result> r = new ArrayList<Result>();
                if (result == null) {
                        return r;
                }
                for (int i = 0; i < result.size(); i++) {
                        Result x = new Result();
                        x.setErrno(result.get(i).getErrno());
                        x.setErrno(result.get(i).getErrno());
                        if (result.get(i).getKeyType() != null) {
                                switch (result.get(i).getKeyType()) {
                                        case BINDING_KEY:
                                                x.setKeyType(KeyType.BINDING_KEY);
                                                break;
                                        case BUSINESS_KEY:
                                                x.setKeyType(KeyType.BUSINESS_KEY);
                                                break;
                                        case SERVICE_KEY:
                                                x.setKeyType(KeyType.SERVICE_KEY);
                                                break;
                                        case T_MODEL_KEY:
                                                x.setKeyType(KeyType.T_MODEL_KEY);
                                                break;
                                }
                        }
                        x.setErrInfo(new ErrInfo());
                        x.getErrInfo().setErrCode(result.get(i).getErrInfo().getErrCode());
                        x.getErrInfo().setValue(result.get(i).getErrInfo().getValue());
                        r.add(x);
                }
               
                return r;
        }
View Full Code Here

   
   
    new ValidateSubscriptionListener().validateNotification(body);
     
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
    return dr;
  }
View Full Code Here

TOP

Related Classes of org.apache.roller.util.Technorati$Result

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.