Package edu.mit.simile.fresnel.purpose

Examples of edu.mit.simile.fresnel.purpose.Purpose


        }
     
        if (conf.hasWarnings())
          writer.println(conf.getWarningsString());
       
        Purpose purpose = null;
       
        /* Look up the requested lens purpose */
        if (request.getParameter("purpose") != null && (!request.getParameter("purpose").equals("defaultPurpose")))
          purpose = new Purpose(new URIImpl(Constants.nsFresnelExt + request.getParameter("purpose")));
        else
          purpose = new Purpose(new URIImpl("http://www.w3.org/2004/09/fresnel#defaultLens")); /* this must be provided, or a random lens is chosen */

        try {
          /* Perform Fresnel selection using the requested display purpose and language */
          selected = conf.select(dataRepository, focalResource, purpose, langPref);
   
View Full Code Here


          try {
            while (purposesI.hasNext()) {
              Value purposeNode = purposesI.next().getObject();
              if (purposeNode instanceof Resource) {
                Resource purposeRes = (Resource) purposeNode;
                out.addPurpose(new Purpose(purposeRes));
              } else {
                throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
              }
            }
          } finally {
View Full Code Here

      try {
        while (purposesI.hasNext()) {
          Value purposeNode = purposesI.next().getObject();
          if (purposeNode instanceof Resource) {
            Resource purposeRes = (Resource) purposeNode;
            out.addPurpose(new Purpose(purposeRes));
          } else {
            throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
          }
        }
      } finally {
View Full Code Here

      try {
        while (purposesI.hasNext()) {
          Value purposeNode = purposesI.next().getObject();
          if (purposeNode instanceof Resource) {
            Resource purposeRes = (Resource) purposeNode;
            out.addPurpose(new Purpose(purposeRes));
          } else {
            throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
          }
        }
      } finally {
View Full Code Here

          try {
            while (purposesI.hasNext()) {
              Value purposeNode = purposesI.next().getObject();
              if (purposeNode instanceof Resource) {
                Resource purposeRes = (Resource) purposeNode;
                addPurpose(new Purpose(purposeRes));
              } else {
                throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
              }
            }
          } finally {
View Full Code Here

     * Check if this lens has a default purpose.
     *
     * @return A <code>boolean</code> indicator
     */
    public boolean isDefault() {
        Purpose defaultP = new Purpose(FresnelCore.defaultLens);
        return hasPurpose(defaultP);
    }
View Full Code Here

      if (null != lenses) {
        // find label lens for resource
        Iterator<Lens> instancesIt = lenses.getInstanceLenses().iterator();
        while (instancesIt.hasNext()) {
          Lens check = instancesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) { 
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
       
        // find label lens for resource's type
        Iterator<Lens> classesIt = lenses.getClassLenses().iterator();
        while (classesIt.hasNext()) {
          Lens check = classesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) {
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
      }

      if (null != instanceLenses) {
        // find label lens for resource
        Iterator<Lens> instancesIt = instanceLenses.getInstanceLenses().iterator();
        while (instancesIt.hasNext()) {
          Lens check = instancesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) { 
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
          }
        }
      }
      if (null != classLenses) {
        // find label lens for resource
        Iterator<Lens> classesIt = classLenses.getClassLenses().iterator();
        while (classesIt.hasNext()) {
          Lens check = classesIt.next();
          if (check.hasPurpose(new Purpose(FresnelCore.labelLens))) {
            AggregateLabel labels = new AggregateLabel(applyLabelLens(check, in, focus, 0, MAXIMUM_LENS_DEPTH));
            if (labels.getString().trim().equals(""))
              continue;
            else
              return new Title(labels);
View Full Code Here

TOP

Related Classes of edu.mit.simile.fresnel.purpose.Purpose

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.