1 26 27 package org.objectweb.openccm.explorer.CosTrading; 28 29 30 import org.objectweb.util.explorer.api.Context; 31 import org.objectweb.util.explorer.api.Entry; 32 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 33 import org.omg.CosTrading.Lookup; 34 import org.omg.CosTradingRepos.ServiceTypeRepository; 35 import org.omg.CosTradingRepos.ServiceTypeRepositoryHelper; 36 37 38 45 public class LookupContext 46 implements Context 47 { 48 49 55 59 private static boolean admin_view_=false; 60 61 67 73 79 86 public static void toogleAdminUserView() 87 { 88 LookupContext.admin_view_ = ! LookupContext.admin_view_; 89 } 90 91 97 100 public Entry[] getEntries(Object object) { 101 Lookup lookup = (Lookup)object; 102 ServiceTypeRepository str = ServiceTypeRepositoryHelper.narrow(lookup.type_repos()); 103 Entry[] values = null; 104 105 if (LookupContext.admin_view_) { 107 values = new Entry[6]; 108 values[0] = new DefaultEntry("Service Type Repository", str); 109 values[1] = new DefaultEntry("Queries", new Queries(lookup)); 110 values[2] = new DefaultEntry("Registered Offers", new Offers(lookup.admin_if())); 111 values[3] = new DefaultEntry("Proxy Offers", new ProxyOffers(lookup.admin_if())); 112 values[4] = new DefaultEntry("Trader Config", lookup.admin_if()); 113 values[5] = new DefaultEntry("Trader Links", lookup.link_if()); 114 } else { 116 values = new Entry[2]; 117 values[0] = new DefaultEntry("Service Type Repository", str); 118 values[1] = new DefaultEntry("Queries", new Queries(lookup)); 119 } 120 return values; 121 } 122 123 } 124 | Popular Tags |