Package org.fao.geonet

Examples of org.fao.geonet.GeonetContext


  public Aligner(Logger log, ServiceContext sc, GeoPRESTParams params) throws Exception {
    this.log        = log;
    this.context    = sc;
    this.params     = params;

    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    dataMan = gc.getBean(DataManager.class);
    result  = new HarvestResult();

    //--- setup REST operation rest/document?id={uuid}

    request = context.getBean(GeonetHttpRequestFactory.class).createXmlRequest(new URL(params.baseUrl+"/rest/document"));
View Full Code Here


    this.context= context;
    this.params = params;

    result = new HarvestResult();
   
    GeonetContext gc = (GeonetContext) context.getHandlerContext (Geonet.CONTEXT_NAME);
    dataMan = gc.getBean(DataManager.class);
    schemaMan = gc.getBean(SchemaManager.class);
    }
View Full Code Here

     */
    public final Element exec(final Element params, final ServiceContext context) throws BadParameterEx, SVNException, IOException, JDOMException {
        MetadataActionListSingleton singleton = MetadataActionListSingleton.getInstance();
        boolean refresh = Util.getParam(params, "refresh", true);
        if (refresh) {
            GeonetContext gc = (GeonetContext) context
                    .getHandlerContext(Geonet.CONTEXT_NAME);
            String repoPath = gc.getBean(ServiceConfig.class).getMandatoryValue(
                    Geonet.Config.SUBVERSION_PATH);
            SVNURL svnurl = SVNURL.fromFile(new File(repoPath));
            SVNRepository repository = SVNRepositoryFactory.create(svnurl);
            MyLogEntryHandler logEntryHandler = new MyLogEntryHandler();
            List<MetadataAction> oldList = singleton.getMetadataActions();
View Full Code Here

    final String[] serviceStatus = {"true"};
    final String[] serviceError = {""};

    Element result = new Element(Jeeves.Elem.RESPONSE);

    GeonetContext gc = (GeonetContext) context
        .getHandlerContext(Geonet.CONTEXT_NAME);
    SchemaManager schemaMan = gc.getBean(SchemaManager.class);

    String schemas[] = schemaList.split(",");

        int count = 0;
    for (String schemaName : schemas) {
View Full Code Here

public class Set implements Service {

  public void init(String appPath, ServiceConfig params) throws Exception {}

  public Element exec(Element params, ServiceContext context) throws Exception {
      GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);

        // Save values in settings
        saveCswServerConfig(params, gc.getBean(SettingManager.class));

        // Process parameters and save capabilities information in database
        saveCswCapabilitiesInfo(params, context);

        // Build response
View Full Code Here

                                    String uuidAction, List<Element> md, String schema, int index,
                                    String source, String sourceName, ServiceContext context,
                                    List<String> id, String createDate, String changeDate,
                                    String groupId, MetadataType isTemplate) throws Exception {

    GeonetContext gc = (GeonetContext) context
        .getHandlerContext(Geonet.CONTEXT_NAME);
    DataManager dm = gc.getBean(DataManager.class);
   

    if (uuid == null || uuid.equals("")
        || uuidAction.equals(Params.GENERATE_UUID)) {
      String newuuid = UUID.randomUUID().toString();
      source = null;

      Log
          .debug(Geonet.MEF, "Replacing UUID " + uuid + " with "
              + newuuid);
      uuid = newuuid;

      // --- set uuid inside metadata
      md.add(index, dm.setUUID(schema, uuid, md.get(index)));
    } else {
      if (sourceName == null)
        sourceName = "???";

      if (source == null || source.trim().length() == 0)
        throw new Exception(
            "Missing siteId parameter from info.xml file");

      // --- only update sources table if source is not current site
            if (!source.equals(gc.getBean(SettingManager.class).getSiteId())) {
                Source source1 = new Source(source, sourceName, true);
                context.getBean(SourceRepository.class).save(source1);
            }
    }
View Full Code Here

    this.log     = log;
    this.context = context;
    this.request = req;
    this.params  = params;

    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    schemaMan = gc.getBean(SchemaManager.class);
    result  = new HarvestResult();
  }
View Full Code Here

     *
     * updataMetadataRecord, add or delete a online source link.
     */
    public Element exec(Element params, ServiceContext context)
        throws Exception {
      GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
        MapServerRepository repo = context.getBean(MapServerRepository.class);
        SettingManager settingsManager = gc.getBean(SettingManager.class);
      String baseUrl = settingsManager.getSiteURL(context);
     
     
      ACTION action = ACTION.valueOf(Util.getParam(params, "action"));
      if (action.equals(ACTION.LIST)) {
View Full Code Here

  //---
  //--------------------------------------------------------------------------

  public Element exec(Element params, ServiceContext context) throws Exception
  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    DataManager dataMan = gc.getBean(DataManager.class);

    String id = Utils.getIdentifierFromParameters(params, context);

    //-----------------------------------------------------------------------
    //--- check access
View Full Code Here

        operationAllowedRepo.deleteAllByIdAttribute(OperationAllowedId_.groupId, iId);
        userGroupRepo.deleteAllByIdAttribute(UserGroupId_.groupId, Arrays.asList(iId));
        groupRepo.delete(iId);
    //--- reindex affected metadata

    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    DataManager   dm = gc.getBean(DataManager.class);


        dm.indexMetadata(Lists.transform(reindex, Functions.toStringFunction()));

        return new Element(Jeeves.Elem.RESPONSE)
View Full Code Here

TOP

Related Classes of org.fao.geonet.GeonetContext

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.