[jboss-svn-commits] JBL Code SVN: r5221 - in labs/jbosslabs/trunk/portal-extensions: forge-common/src/java/org/jboss/forge/common/soa forge-common/src/java/org/jboss/forge/common/soa/primates primates/src/java/org/jbosslabs/portlets/primates primates/src/java/org/jbosslabs/portlets/primates/service
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 21 12:32:59 EDT 2006
Author: unibrew
Date: 2006-07-21 12:32:51 -0400 (Fri, 21 Jul 2006)
New Revision: 5221
Modified:
labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/LabsServices.java
labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimateDTO.java
labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimatesService.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceImpl.java
labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceLocal.java
Log:
[JBLAB-726] Making service methods, updating LGPL and authors.
Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/LabsServices.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/LabsServices.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/LabsServices.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.forge.common.soa;
import javax.management.MalformedObjectNameException;
@@ -6,6 +28,10 @@
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.mx.util.MBeanServerLocator;
+/**
+ * @author <a href="mailto:tomasz.szymanski at jboss.com">Tomasz Szymanski</a>
+ */
+
public class LabsServices {
public static PrimatesService getPrimatesService()
throws MalformedObjectNameException {
Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimateDTO.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimateDTO.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimateDTO.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.forge.common.soa.primates;
import java.util.Iterator;
@@ -7,6 +29,11 @@
import org.jboss.portal.common.context.DelegateContext;
+/**
+ * @author <a href="mailto:tomasz.szymanski at jboss.com">Tomasz Szymanski</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+
public class PrimateDTO {
private Set<String> logins;
Modified: labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimatesService.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimatesService.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/forge-common/src/java/org/jboss/forge/common/soa/primates/PrimatesService.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.forge.common.soa.primates;
import org.jboss.portal.core.model.User;
@@ -2,2 +24,6 @@
+/**
+ * @author <a href="mailto:tomasz.szymanski at jboss.com">Tomasz Szymanski</a>
+ */
+
public interface PrimatesService {
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primate.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
import java.io.File;
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/Primates.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
import java.util.ArrayList;
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesDescriptor.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
import org.apache.xerces.parsers.DOMParser;
@@ -13,6 +35,7 @@
/**
* @author Damon Sicore
* @author adamw
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
* A class which handles xml parsing of the primates.xml
*/
public class PrimatesDescriptor
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesNodeWatcher.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,5 +1,31 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
+/**
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+
import org.jboss.shotoku.ContentManager;
import org.jboss.forge.common.service.NodeWatcher;
import org.jboss.forge.common.service.ResourceWatcher;
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesPortlet.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
import java.io.IOException;
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/PrimatesTools.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates;
import org.jboss.forge.common.ForgeHelper;
@@ -8,6 +30,7 @@
/**
* @author adamw Common constants and functions.
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
*/
public class PrimatesTools {
final static String PRIMATES_ELEMENT = "primates";
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceImpl.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceImpl.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceImpl.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,3 +1,25 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates.service;
import java.util.Iterator;
@@ -20,6 +42,11 @@
import org.jbosslabs.portlets.primates.PrimatesDescriptor;
import org.jbosslabs.portlets.primates.PrimatesTools;
+/**
+ * @author <a href="mailto:tomasz.szymanski at jboss.com">Tomasz Szymanski</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ */
+
@Service(objectName = PrimatesService.PRIMATES_SERVICE)
@Local(PrimatesServiceLocal.class)
@Management(PrimatesService.class)
@@ -72,27 +99,25 @@
public PrimateDTO getPrimate(String nickname, String portalName) {
- try {
- InitialContext initialContext = new InitialContext();
+ DelegateContext context = new DelegateContext();
+ PrimatesDescriptor desc = PrimatesTools.getDesc(portalName);
+ desc.getContext(context, portalName);
- UserModule userModule = (UserModule) initialContext
- .lookup(userModuleCtx);
+ Iterator<DelegateContext> iterator = context.childIterator("primate");
+ while (iterator.hasNext()) {
+ DelegateContext primate = iterator.next();
+ Iterator<String> it = primate.childIterator(Primate.USER_LOGINS_ELEMENT);
+ if (it!=null) {
+ while (it.hasNext()) {
+ if (it.next().compareTo(nickname)==0) {
+ return new PrimateDTO(primate);
+ }
+ }
+ }
+ }
- User user = userModule.findUserByUserName(nickname);
-
- return getPrimate(user.getGivenName(), user.getFamilyName(),
- portalName);
- } catch (NamingException e) {
- log.error(e);
- } catch (IllegalArgumentException e) {
- log.error(e);
- } catch (NoSuchUserException e) {
- log.error(e);
- } catch (ModuleException e) {
- log.error(e);
- }
-
- return null;
+ // there is no such primate
+ return null;
}
public User getUser(String username) {
Modified: labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceLocal.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceLocal.java 2006-07-21 15:59:13 UTC (rev 5220)
+++ labs/jbosslabs/trunk/portal-extensions/primates/src/java/org/jbosslabs/portlets/primates/service/PrimatesServiceLocal.java 2006-07-21 16:32:51 UTC (rev 5221)
@@ -1,5 +1,31 @@
+ /*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jbosslabs.portlets.primates.service;
+/**
+ * @author <a href="mailto:tomasz.szymanski at jboss.com">Tomasz Szymanski</a>
+ */
+
public interface PrimatesServiceLocal {
}
More information about the jboss-svn-commits
mailing list