Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Added mypic support to the author lists

- Changed the newsEntry CC to take an author name rather than the image
URL
- Changed the Person class to return mypic URLs as needed
- Changed the PersonsCache class to add the doc UNID to the Person
object
  • Loading branch information...
commit f9a66c71335edda439d742147a00824cf9608e50 1 parent 19b7b9f
@jesse-gallagher jesse-gallagher authored
View
7 disk-collaborationtoday/Code/Java/com/ZetaOne/mypic/Api.java
@@ -163,8 +163,7 @@ public void getMyPic() {
mypic = JSFUtil.getCurrentDatabase().getDocumentByUNID(mypicId);
}
- ApplicationSettings appSettings = (ApplicationSettings) JSFUtil.resolveVariable("ApplicationSettings");
- String format = (JSFUtil.getContext().getUrl().hasParameter("format")) ? JSFUtil.getContext().getUrl().getParameter("format") : appSettings.getDefaultFormat();
+ String format = (JSFUtil.getContext().getUrl().hasParameter("format")) ? JSFUtil.getContext().getUrl().getParameter("format") : "png";
BufferedImage img;
if (null == mypic) {
@@ -210,8 +209,8 @@ public void getMyPic() {
h = new Integer(JSFUtil.getContext().getUrl().getParameter("size"));
}
} else {
- w = new Integer(appSettings.getDefaultSize());
- h = new Integer(appSettings.getDefaultSize());
+ w = 64;
+ h = 64;
}
BufferedImage dst = null;
View
15 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/Person.java
@@ -30,19 +30,22 @@
private String _displayName;
private String _pictureType;
private String _pictureURL;
+ private String documentId;
public Person(String pID, String displayName, String twitter,
- String eMailAddress, String pictureType, String pictureURL) {
+ String eMailAddress, String pictureType, String pictureURL,
+ String documentId) {
_pID = pID;
_eMailAddress = eMailAddress;
_twitter = twitter;
_displayName = displayName;
_pictureType = pictureType;
_pictureURL = pictureURL;
+ this.documentId = documentId;
}
public static Person getEmptyPerson() {
- return new Person("", "", "", "", "", "");
+ return new Person("", "", "", "", "", "", "");
}
public String getPID() {
@@ -68,10 +71,9 @@ public String getDisplayName() {
}
public String getPictureURL() {
- String output = "head.png";
if (_pictureType != null) {
if (_pictureType.equalsIgnoreCase("multiple")) {
- output = "heads.png";
+ return "heads.png";
}
if (_pictureType.equalsIgnoreCase("gravatar")) {
return getGravatarURL();
@@ -81,8 +83,11 @@ public String getPictureURL() {
return _pictureURL;
}
}
+ if(_pictureType.equalsIgnoreCase("mypic")) {
+ return "/mypicApi.xsp?method=getmypic&id=" + this.documentId;
+ }
}
- return output;
+ return "head.png";
}
public String getGravatarURL() {
View
11 disk-collaborationtoday/Code/Java/org/openntf/news/http/core/PersonsCache.java
@@ -70,12 +70,13 @@ private synchronized void init() {
List<Object> columnValues = entry.getColumnValues();
Person person = new Person(
- (String)columnValues.get(5),
+ (String)columnValues.get(5),
(String)columnValues.get(0),
- (String)columnValues.get(1),
- (String)columnValues.get(2),
- (String)columnValues.get(3),
- (String)columnValues.get(4));
+ (String)columnValues.get(1),
+ (String)columnValues.get(2),
+ (String)columnValues.get(3),
+ (String)columnValues.get(4),
+ entry.getUniversalID());
_persons.put((String)columnValues.get(5), person);
tmpEntry = viewNavigator.getNext();
View
20 disk-collaborationtoday/CustomControls/newsEntry.xsp
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
+ <xp:this.dataContexts>
+ <xp:dataContext var="authorPictureURL" value="#{javascript:personsCache.getPerson(compositeData.author).getPictureURL()}"/>
+ </xp:this.dataContexts>
+
<div class="row-fluid newsentry">
- <!--
- <div class="span1"> <xp:link
- value="#{javascript:compositeData.authorPictureURL}" target="_blank">
- <xp:image url="#{javascript:compositeData.authorPictureURL}"
- style="margin:0px 0 0 0;width:42px;height:42px;"></xp:image>
- </xp:link> </div>
- -->
<div class="span12">
- <!--<xp:link
- style="height:80px;width:80px;float:left;clear:left;margin-left:0;vertical-align:text-top;"
- value="#{javascript:compositeData.authorPictureURL}" target="_blank">
- <xp:image styleClass="newsEntryImage" url="#{javascript:compositeData.authorPictureURL}"
- style="margin:0px 0 0 0;width:64px;height:64px;"></xp:image>
- </xp:link>
- -->
<div class="newsEntryImageDiv">
- <xp:image styleClass="newsEntryImage" url="#{javascript:compositeData.authorPictureURL}"></xp:image>
+ <xp:image styleClass="newsEntryImage" url="#{authorPictureURL}"></xp:image>
</div>
<!--<xp:div styleClass="expandNews" id="expandDiv">
<xp:this.rendered><![CDATA[#{javascript:if (compositeData.imageURL == null) {
View
2  disk-collaborationtoday/CustomControls/newsEntry.xsp-config
@@ -14,7 +14,7 @@
</designer-extension>
</composite-extension>
<property>
- <property-name>authorPictureURL</property-name>
+ <property-name>author</property-name>
<property-class>string</property-class>
</property>
<property>
View
4 disk-collaborationtoday/CustomControls/topStories.xsp
@@ -34,7 +34,7 @@ return true;}]]></xp:this.rendered>
<xp:repeat id="r1" var="entryT" rows="4"
value="#{javascript:newsCache.getTopTopStories();}" >
<xc:newsEntry id = "lkj"
- authorPictureURL="#{javascript:personsCache.getPerson(entryT.getPID()).getPictureURL()}"
+ author="#{entryT.PID}"
imageURL="#{javascript:entryT.getImageURL()}" link="#{javascript:entryT.getLink()}"
newsAbstract="#{javascript:entryT.getAbstract()}" nID="#{javascript:entryT.getID()}"
personDisplayName="#{javascript:personsCache.getPerson(entryT.getPID()).getDisplayName()}"
@@ -74,7 +74,7 @@ return true;}]]></xp:this.rendered>
<xp:repeat id="r3" var="entryC" rows="4"
value="#{javascript:newsCache.getTopStories(category.getID());}" >
<xc:newsEntry id = "lkasdfj"
- authorPictureURL="#{javascript:personsCache.getPerson(entryC.getPID()).getPictureURL()}"
+ author="#{entryC.PID}"
typeId="#{javascript:entryC.getTID()}"
imageURL="#{javascript:entryC.getImageURL()}" link="#{javascript:entryC.getLink()}"
newsAbstract="#{javascript:entryC.getAbstract()}" nID="#{javascript:entryC.getID()}"
View
1  disk-collaborationtoday/WebContent/WEB-INF/faces-config.xml
@@ -43,7 +43,6 @@
</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
</managed-bean>
-
<render-kit>
<renderer>
<component-family>javax.faces.Graphic</component-family>
View
4 disk-collaborationtoday/XPages/home.xsp
@@ -31,7 +31,7 @@
}]]></xp:this.value>
<xc:newsEntry id="lkewrej"
- authorPictureURL="#{javascript:personsCache.getPerson(entryA.getPID()).getPictureURL()}"
+ author="#{entryA.PID}"
typeId="#{entryA.TID}"
imageURL="#{entryA.imageURL}" link="#{entryA.link}" newsAbstract="#{entryA.abstract}"
nID="#{entryA.ID}" personDisplayName="#{javascript:personsCache.getPerson(entryA.getPID()).getDisplayName()}"
@@ -64,7 +64,7 @@
<xp:repeat id="r2" var="entryAB" rows="30" value="${newsCache.entriesByPopularity}" removeRepeat="true">
<xc:newsEntry id="lasdfekj"
- authorPictureURL="#{javascript:personsCache.getPerson(entryAB.getPID()).getPictureURL()}"
+ author="#{entryAB.PID}"
typeId="#{entryAB.TID}"
imageURL="#{entryAB.imageURL}" link="#{entryAB.link}" newsAbstract="#{entryAB.abstract}"
nID="#{entryAB.ID}" personDisplayName="#{javascript:personsCache.getPerson(entryAB.getPID()).getDisplayName()}"
View
14 disk-collaborationtoday/XPages/mypicApi.xsp.metadata
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><note class="form" maintenanceversion="3.0" replicaid="85257AA6004F5595" version="8.5" xmlns="http://www.lotus.com/dxl">
-<noteinfo noteid="506" sequence="15" unid="B2E42B4620DE541585257AB6007D3821">
+<noteinfo noteid="506" sequence="16" unid="B2E42B4620DE541585257AB6007D3821">
<created><datetime>20121114T174743,69-05</datetime></created>
-<modified><datetime>20121119T124618,99-05</datetime></modified>
-<revised><datetime>20121119T124618,97-05</datetime></revised>
-<lastaccessed><datetime>20121119T124618,97-05</datetime></lastaccessed>
+<modified><datetime>20121119T130405,25-05</datetime></modified>
+<revised><datetime>20121119T130405,23-05</datetime></revised>
+<lastaccessed><datetime>20121119T130405,23-05</datetime></lastaccessed>
<addedtofile><datetime>20121115T072752,88-05</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Jesse Gallagher/O=Frost</name></updatedby>
<wassignedby><name>CN=Jesse Gallagher/O=Frost</name></wassignedby>
@@ -15,8 +15,8 @@
+<item name="$Comment" sign="true"><text>Non-UI - mypic</text></item>
+<item name="$DesignerVersion"><text>8.5</text></item>
-
-<item name="$Comment" sign="true"><text>Non-UI - mypic</text></item>
-<item name="$DesignerVersion" sign="true"><text>8.5.3</text></item></note>
+</note>
Please sign in to comment.
Something went wrong with that request. Please try again.